10.6. Message-driven EJBs

The only portable mechanism by which an EJB can receive JMS messages is through the use of message-driven EJBs. As message-driven EJBs are new in Version 2.0 of the EJB Specification, this implies that there is no portable way for a container that supports only earlier versions to receive asynchronous messages.

Hint

It is possible to simulate the functionality of message-driven EJBs in a system that has no support for them by writing a standalone Java program that monitors a message queue for incoming messages and calls a stateless session bean on the receipt of each message. It is an interesting exercise to consider how this differs from what happens in a ‘real’ message-driven EJB.

A message-driven EJB registers an ...

Get Applied Enterprise JavaBeans™ Technology 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.