A Message-Driven Bean Example
A Message-Driven Bean Example
A Message-Driven Bean Example
Message-driven beans can implement any messaging type. Most commonly, they implement
the Java Message Service (JMS) technology. The example in this chapter uses JMS technology,
so you should be familiar with basic JMS concepts such as queues and messages. To learn about
these concepts, see
This chapter describes the source code of a simple message-driven bean example. Before
proceeding, you should read the basic conceptual information in the section
as well as
in
simplemessage
Example Application Overview
The simplemessage application has the following components:
SimpleMessageClient
: An application client that sends several messages to a queue
SimpleMessageEJB
: A message-driven bean that asynchronously receives and processes the
messages that are sent to the queue
illustrates the structure of this application. The application client sends messages to
the queue, which was created administratively using the Admin Console. The JMS provider (in
this case, the Application Server) delivers the messages to the instances of the message-driven
bean, which then processes the messages.
23
C H A P T E R
2 3
675