Using JMS with a Message Queue
In the following example, a message queue is used to process orders for sales of movies. A queue has been established in the JBoss message queue with the JNDI name of queue/movie-orders. The client application inserts a set of orders into the queue. An order listener is created to listen to the queue and, when orders are available, retrieves the orders and processes them. Order processing is performed using helper classes.
Since these examples use a message queue and expect to perform asynchronous messaging, there is no timing requirement between the client and the recipient. If the recipient of the message is not connected to the queue, the message is stored (persisted) until some point in the future when a process ...
Get J2EE™ and Beyond: Design, Develop, and Deploy World-Class Java™ Software now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.