O'Reilly logo

EJB 3.1 Cookbook by Richard M. Reese

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Specifying which types of message to receive using the message selector

A message selector is a string containing an expression used to control which messages are consumed by which MDBs. The application used in this recipe submits different messages to the same queue. The messages are then sent to different MDBs based on their message selector settings.

Getting ready

The essential structure of a servlet used to generate a message was introduced in the introduction. We will be using a TextMessage to demonstrate the message selection process. This message type is discussed earlier in this chapter under the Handling a text-based message recipe. Here we will address the unique elements of creating and using a TextMessage to support a message selector ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required