Answers

Question and Answer:

  Home  BEA Weblogic

⟩ How do I handle request/response using JMS?

There are several approaches to handling request/response processing with JMS.

* Use a temporary queue for each requestor and have the response go back to that queue.

* Use the QueueRequestor class, which does the temporary queue for you, and wait for the reply, as in the following:

// create temporary queue for receiving answer

qrequestor = new QueueRequestor(qsession, queue);

TextMessage msg = qsession.createTextMessage();

TextMessage reply = (TextMessage) qrequestor.request(msg);

* Use a dedicated response topic or queue with message selectors.

 215 views

More Questions for you: