activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Pechorin <>
Subject ActiveMQ-CPP: how to send to temp queue?
Date Thu, 16 Jul 2009 13:56:07 GMT


I'm trying to implement Request-Response pattern with:
 - ActiveMQ broker,
 - NMS (C#) on the client (requestor) side,
 - CMS (ActiveMQ-CPP) on the server (responder) side.

This pattern is described very clearly 
 - for JMS:
 - for NMS:

So, on the ActiveMQ-CPP side I perform the following steps:
 1) create consumer that receives request from normal (permanent) queue,
 2) obtain ReplyTo from the request using method getCMSReplyTo() of
 3) dynamic_cast from cms::Destination* to cms::TemporaryQueue*, 
 4) retrieve name of the temporary queue using method getQueueName() of
cms::TemporaryQueue (cms::Destination doesn't have this method),
 5) store name of the temporary queue in std::string,
 6) when a reply is ready, I need to send it to the temporary queue
specified by client in ReplyTo of the request.

The problem is that I don't understand how to send a message to a temporary
queue by its name.

For normal queues, I resolve a destination by its name using method
resolveDestinationName() of activemq::cmsutil::DynamicDestinationResolver.
However, it seems like DynamicDestinationResolver has nothing to do with
temporary queues.

Should I cast cmd::TemporaryQueue to activemq::commands::ActiveMQTempQueue,
clone it using cloneDataStructure() and store a pointer to this object
instead of storing std::string with a name of the temporary queue?

P.S. I tried hard to find answer on this question in this mailing list, in
ActiveMQ-CPP examples and docs, but I failed.

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

View raw message