BEA Weblogic Question:
Download Questions PDF

What precautions should I take when I use blocking receive() calls?

Answer:

If your application design requires messages to be received synchronously, we recommend using one of the following methods listed in order of preference:
* Pass a timeout value as an argument to the receive() method and set it to the minimum value greater than zero, that is allowed by the application to avoid consuming threads that are waiting for a response from the server.
* Use the receiveNoWait() method which returns the next message or a null value if no message is currently available. In this case, the call does not block. The servlet should provide a way to return to or reschedule the request, without calling wait().
Note: Use of this option should be minimized, as it may deadlock a busy server.
* Ensure that more threads are configured than the number of possible simultaneous blocking receive() calls.

Download BEA Weblogic Interview Questions And Answers PDF

Previous QuestionNext Question
How do I manage a queue to view and delete specific messages?When should I use multicast subscribers?