8.5. ShipOrder Message-Driven Bean
Asynchronous messages are useful for instigating tasks that take a long time to complete. The sender doesn't have to wait for a message to be delivered or for a receiver to carry out the subsequent request. Furthermore, loose coupling between senders and receivers makes systems more flexible as requirements change.
In this section we'll show you a JMS client producer that uses PTP messaging to interact with our online Music Collection Order processing system. This client, OrderApp, sends a message to a ShipOrder message-driven bean (ShipOrderBean). Upon receipt, the message-driven bean invokes a business method (shipOrdersByDate()) in our CustomerSession EJB. Recall that this method ships all orders with an ...
Get Enterprise JavaBeans™ Component Architecture: Designing and Coding Enterprise Applications 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.