activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mittler, Nathan" <nathan.mitt...@sensis.com>
Subject RE: activemq-cpp getStringProperty
Date Tue, 09 Oct 2007 18:27:04 GMT
I was using trunk, but I suspect that 2.1 should yield the same results.

> -----Original Message-----
> From: cmaxo [mailto:cmaxo@engineer.com] 
> Sent: Tuesday, October 09, 2007 12:39 PM
> To: dev@activemq.apache.org
> Subject: Re: activemq-cpp getStringProperty
> 
> 
> 
> 
> Ah - I see what's going on.  Looks like you have a slight 
> programming error in this line:
> 
> char *propValue = 
> textMessage->getStringProperty("session_id").c_str();
> 
> You're getting a pointer to the internal char* of a temporary 
> string object ... not a good idea :).  Instead, change the 
> code to this and it should work fine.
> 
> string propValue = textMessage->getStringProperty("session_id");
> 
> This worked for me.
> 
> Regards,
> Nate
> 
> 
> Hmm, I made that change but I still get an exception.  The 
> exception specifically states the property is not available.  
> Do you mind telling me what version of the activemq-cpp code 
> you are using and what version of the activemq server you are 
> using?  Maybe I've got something wrong.
> 
> Thanks,
> Corey
> --
> View this message in context: 
> http://www.nabble.com/activemq-cpp-getStringProperty-tf4576622
> s2354.html#a13119494
> Sent from the ActiveMQ - Dev mailing list archive at Nabble.com.
> 
> 

Mime
View raw message