Message-driven beans

A Message Driven Bean (MDB) responds asynchronous messages delivered by the application server’s message engine. The MDB model integrates the EJB component architecture with the Java Message Service (JMS) asynchronous messaging API and other messaging APIs.

An MDB component is similar to an EJB stateless session bean, but the MDB component responds only to asynchronous messages and has no direct client interface. Rather than having remote or local interfaces, an MDB that responds to JMS messages must implement the javax.jms.MessageListener interface. EAServer calls the onMessage method to deliver messages to the MDB.

An MDB must be attached to a message source such as a JMS message queue or topic. You can invoke the MDB asynchronously by posting a message to this queue or topic.

For more information, see “Message-driven beans” in the JMS User’s Guide.