Programming to use message-driven beans

Applications can use message-driven beans (a type of enterprise bean defined in the EJB specification) as asynchronous message consumers.

 

Overview

A client sends messages to the destination (or endpoint) for which the message-driven bean is deployed as the message listener. When a message arrives at the destination, the EJB container invokes the message-driven bean automatically without an application having to explicitly poll the destination. The message-driven bean implements some business logic to process incoming messages on the destination.

EJB 2.0 message-driven beans support only Java Message Service (JMS) messaging. EJB 2.1 message-driven beans can handle other messaging types in addition to JMS. The message-driven bean class must implement the message listener interface for the messaging type that the message-driven bean handles. For example, an EJB 2.1 message-driven bean class used for JMS messaging must implement the javax.jms.MessageListener interface.

You can use Rational Application Developer to develop applications that use message-driven beans. Use the WAS runtime tools, like the administrative console, to deploy and administer applications that use message-driven beans.

For more information about implementing WebSphere enterprise applications that use message-drive beans, see the following topics:

 

See also


Designing an enterprise application to use message-driven beans
Developing an enterprise application to use message-driven beans
Deploying an enterprise application to use message-driven beans against JCA 1.5-compliant resources
Message-driven beans samples
Deploying an enterprise application to use EJB 2.0 message-driven beans with listener ports