activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmaxo <>
Subject Re: activemq-cpp getStringProperty
Date Tue, 09 Oct 2007 16:38:39 GMT

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

string propValue = textMessage->getStringProperty("session_id");

This worked for me.


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.

View this message in context:
Sent from the ActiveMQ - Dev mailing list archive at

View raw message