Typically, the best way to accomplish request/reply is to use a temporary queue. Like this:
- JMS client A creates a temporary queue - JMS client A produces message to request queue - On that message, the temporary queue is set as the JMSReplyTo using javax.jms.Message.setJMSReplyTo() - JMS client B consumes the request from the request queue - JMS client B then produces a message to the temporary queue using MessageProducer(requestMessage.getReplyTo(), replyMessage) There are variations. The good thing about temporary queues is that they are automatically deleted by the broker when the client disconnects, so there will never be idle messages sitting around. If you need those messages to remain until consumed, then switching to a permanent queue that's dedicated to the client usually does the trick. Hope this helps. BTW, correlation ID can be used together with selectors to solve this. However, I would not recommend using selectors if they can be avoided at all. -- Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-Dev-f2368404.html
