BEA Weblogic Question:
Download Questions PDF

How do I handle request/response using JMS?

Answer:

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.

Download BEA Weblogic Interview Questions And Answers PDF

Previous QuestionNext Question
How many messages are sent across the network for processing topic messages?Is it OK to add new sessions and subscribers to a Queue or Topic Connection once it has been started?