Message-Driven Beans
MDBs are a new addition to J2EE. As mentioned previously, these beans provide a mechanism for providing a messaging server within the application server using EJB components. Prior to the inclusion of MDBs in the J2EE specification, application server vendors provided their own messaging services. While having a messaging service available was useful, what was really needed was a facility to perform messaging processing in the context of the EJB container. MDBs provide that capability using the JMS package interface.
The following code provides an example of a minimal implementation of an MDB. The client application creates a message, locates the message queue, and then sends the message. The server component, the MDB, is ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access