activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "klaus.holst.jacobsen" <>
Subject CMS 3.9.2 process hangs when calling setMessageListener(..) in onMessage(...)
Date Thu, 22 Jun 2017 08:48:14 GMT

I would like to send a request and get a reply from a message handlers
onMessage(...) method.

Something like this:

void MyClass::onMessage(cms::Message m)
cms::Destination* tempDest = session_->createTemporaryQueue();
cms::MessageConsumer* responseConsumer = session_->createConsumer(tempDest);

SomeOtherMessageHandler replyHandler;

cms::Message* request = session_->createTextMessage();

...wait for response...

cms::Message* response = replyHandler.getResponse();


...but my code hangs in setMessageListener(...);
My guess is that because I am in the onMessage method i have locked a mutex
that is required to do setMessageHandler(...)

Is this an error or not? 
In any case, what is the work-around to be able to do request/reply from a
message handler?

Thanks in advance.


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

View raw message