Chapter 3. Message-Driven Beans

In this chapter, we will cover:

  • Handling a text-based message
  • Handling a byte-based message
  • Handling a stream-based message
  • Handling a map-based message
  • Handling an object-based message
  • Using MDB in a publish-and-subscribe application
  • Using MDB in a point-to-point application
  • Specifying which types of messages to receive using the message selector
  • Browsing messages in a message queue


A Message-Driven Bean (MDB) implements business logic in an asynchronous fashion. The client does not receive a response to the message from the MDB. A client will send a message to a queue or topic. The message is then retrieved and processed by the MDB. A queue differs from a topic in that a message in a queue is sent to a single ...

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.