The message-driven bean was introduced in EJB 2.0 to support the processing of asynchronous messages from a Java Message Service (JMS) provider. Although the JMS-based MDB of EJB 2.0 has proven very useful, it has limitations. Perhaps the most glaring is that EJB vendors support only a small number of JMS providers (usually only one). In fact, many EJB 2.0 vendors support only their own JMS provider and not others.
EJB 2.1 expands the definition of the message-driven bean so that it can support any messaging system, not just JMS. The more open definition of message-driven beans that allows them to handle just about any kind of messaging system from any vendor. EJB 2.1 vendors are still required to support JMS-based MDBs, but they are no longer limited to JMS. EJB 2.1 vendors can support any messaging system they want. The only requirement is that new types of message-driven beans implement the javax.ejb.MessageDrivenBean interface and adhere to the message-driven bean's life cycle. The vendors can build custom code to support a new messaging system (something other than JMS).
J2EE Connector Architecture 1.5 defines a messaging contract specifically tailored to message-driven beans. It defines the contracts between an EJB container and an asynchronous connector so that incoming message from the EIS is automatically processed by message-driven beans within a transaction started by the EJB container. The MDBs that are based on an asynchronous connector will implement the standard javax.ejb.MessageDrivenBean interface as well as a specific messaging interface defined by the connector itself. So instead of implementing the javax.jms.MessageListener interface, the MDB will implement some other type of interface that is specific to the EIS.
Monday, February 25, 2008
Message-Driven Beans in EJB
Subscribe to:
Post Comments (Atom)

No comments:
Post a Comment