When to use Message Driven Beans?
When to use Message Driven Beans?
A message-driven bean is an enterprise bean that allows Java EE applications to process messages asynchronously. This type of bean normally acts as a JMS message listener, which is similar to an event listener but receives JMS messages instead of events. Message driven beans are used to receive messages asynchronously.
For example, in an on-line shopping application, where the process of taking an order from a customer results in a process that issues a purchase order to a supplier, the supplier ordering process could be implemented by a message-driven bean. While taking the customer order always results in placing a supplier order, the steps are loosely coupled and asynchronous because it is not necessary to generate the supplier order before confirming the customer order.