Chapter 6. Using Message-Driven Beans and Connectors

Enterprise applications must be able to use data from existing legacy systems and a wide variety of databases. Processes within applications must be able to not only communicate with one another but also send and receive data to and from other applications. This communication within and between enterprise applications and data stores is essential in business operations. J2EE-distributed applications rely on messaging systems, such as Java Message Service (JMS), for highly reliable and scalable communications and on J2EE connectors to facilitate integrating with underlying data stores and legacy systems. The EJB architecture introduces a new enterprise bean type specifically designed to handle asynchronous communication. Whereas earlier releases of the EJB architecture supported only a synchronous mode of communication, the EJB 2.0 and 2.1 architectures use a message-driven bean to support asynchronous communication. Message-driven beans make it easy for J2EE applications to process asynchronous messages.

Messaging systems, such as JMS, allow separate, uncoupled applications to communicate asynchronously and reliably, based on an architecture in which individual components communicate on a peer-to-peer basis. Messaging systems not only promote loose coupling between sending and receiving components but also allow a high degree of anonymity between senders and receivers. To the message receiver, or consumer, it doesn't matter who produced the message, when it was produced, and from where it was sent.

Message-driven beans serve as router processes that operate on incoming enterprise messages from a message service provider. A bean developer might use a message-driven bean to integrate an EJB-based system with a legacy system or to enable business-to-business interactions. The message-driven bean's sole responsibility is to process messages, because its container automatically manages the component's entire environment.

This chapter provides background information on the communication modes available to enterprise applications, including an overview of JMS and how it facilitates enterprise application integration. The chapter describes concepts of message-driven beans and extends the benefits enrollment example from the previous chapters to illustrate effective use of message-driven beans.

This chapter also demonstrates how applications can communicate using the J2EE Connector architecture and connectors. In brief, the J2EE Connector architecture is a standard API for connecting the J2EE platform to enterprise information systems, such as enterprise resource planning, mainframe transaction processing, and database systems. The Connector architecture defines a set of scalable, secure, and transactional mechanisms, adherence to which facilitates integrating an enterprise information system with a J2EE platform. Refer to the section Other Sources of Information on page xviii for more information on the J2EE Connector architecture.



Applying Enterprise Javabeans
Applying Enterprise JavaBeans(TM): Component-Based Development for the J2EE(TM) Platform
ISBN: 0201702673
EAN: 2147483647
Year: 2003
Pages: 110

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net