Message-Driven Beans

A message-driven bean (MDB) is, by design, an asynchronous message consumer. The container invokes an MDB as the result of the arrival of a JMS message. An MDB has neither a home nor a remote interface, and consists of only the message bean class and a deployment descriptor. The bean class must implement both the MessageDrivenBean interface and the MessageListener interface. An MDB is container managed, and all configurable administered objects are specified declaratively in the deployment descriptor. A client accesses a message-driven bean through JMS by sending messages to the JMS Destination (Queue or Topic) for which the MDB class is the MessageListener. The client has no direct interaction with MDBs (see Figure 13.7 ...

Get Sams Teach Yourself EJB in 21 Days 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.