Creating a simple message-driven bean

Message-Driven Beans (MDB) are used to support asynchronous communication within an application. Typically, they are used in conjunction with a queue. A client will send a message to a queue and the MDB will then process the message in the queue. The client does not call the MDB directly, but instead communicates through messages. The MDB never returns a value to the client.

Java Message Service (JMS) is the basis for communication between a client and the MDB. Fortunately, many of the details needed to use JMS are hidden thus making the job of the EJB developer easier.

In this recipe we show how to create the MDB. In the next recipe, we will modify the SalutationServlet developed in the second recipe to ...

Get EJB 3.1 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.