How to create temporary queue and access it in JMS 2

383 Views Asked by At

I am working on a JMS client server app where client first send some data to server through a common queue for all clients and server gives respond to it in a temporary queue created by client itself. I googled it but could not find how can I implement it in JMS 2 as the traditional approach of creating temporary queue is by using session but in JMS 2 I am using JMSContext through which I am creating producer and consumer. My question is how and where

1

There are 1 best solutions below

4
On

In the JMS 2.0 JMSContext API the createTemporaryQueue and createTemporaryTopic server the same role as the traditional versions did in the JMS 1.1 Session style. The JMSContext is really just wrapping the ideas of Connection and Session into one object.

You also have all the same methods create creating messages and setting JMSReplyTo on them, in the consumer you need to consume a Message instance and then use the getJMSReplyTo to get at the reply queue