|
Java™ by example!
|
|
|
How do I receive a message asynchronously from a JMS queue?
I used openjms to develop this example. Check out this Q&A first! The following example receives a message asynchronously from the testqueue queue. The acknowledgement mode is set to AUTO_ACKNOWLEDGE, which means that the session will automatically acknowledges a client's receipt of a message. With asynchronous reception, the onMessage method of your implementation of MessageListener is called when there is a message available on the queue. To receive message synchronously, check this Q&A. Main.java:
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|