What Is the Java Message Service API?


In today's organizations, the movement toward distributed computing is influencing a requirement for software processes (applications and components ) to interact with each other and exchange information across heterogeneous technology languages, platforms, and protocols.

The Java Message Service is a Java API that is an important part of J2EE because it defines a common set of Java interfaces and semantics for Java applications to create, send, receive, and read messages via an enterprise messaging system, which within a distributed application framework can serve as an ideal integration point for applications, including legacy and external systems. Messaging products, commonly referred to as Message-Oriented Middleware (MOM), enable separate software applications and components ( clients ) to communicate and coordinate their activity via messages by providing critical services such as message queuing, guaranteed once-and-only-once delivery, priority delivery, and transaction support.

It is important to understand that JMS is a Java API for accessing Message-Oriented Middleware for the production, distribution, and delivery of asynchronous and transaction-oriented messages. When the JMS API was first introduced in 1998, its mission was to enable Java applications to interoperate with MOMs such as MQSeries from IBM and TIB/Rendezvous from TIBCO Software. Today, many messaging system vendors have adopted and implemented the JMS API, which minimizes the interfaces a Java developer has to learn to leverage a messaging system. Developers writing in other languages have their own APIs for accessing MOM services. Hence, a J2EE application can use JMS to send a message and a C++ application can use a C++ API to receive a message. Communication between these decoupled components can span both machine and language boundaries.

Note

Messaging is peer-to-peer; hence all users of JMS are referred to generically as clients.


With the addition of the JMS API to the J2EE 1.3 platform 1.3, any J2EE component (an Enterprise JavaBean or a Web component) can send or synchronously receive a JMS message. Also, message-driven beans can be used to enable the asynchronous consumption of messages, and message sends and receives can now participate in Java Transaction API (JTA) transactions.

Note

A JMS provider can also implement message-driven beans to process messages concurrently.


JMS Messaging Versus Tightly Coupled Communication APIs

The real power of JMS is derived from the fact that the communication format is a message, which provides a level of abstraction that enables you to separate the details about the destination system from the source application code. For example, using JMS, a component can send a message to a destination, and the recipient can retrieve it from that destination. However, the sender and receiver do not have to be available at the same time in order to communicate, or need to know anything about each other. They both only need to know what message format is being used to communicate and what destination to use to send and receive the message. In this respect, messaging differs from tightly coupled technologies such as Remote Method Invocation (RMI) or Remote Procedure Calls (RPC), which both require an application to know a remote application's interface ( methods ).

There are many scenarios where JMS messaging is a preferred communication means over a tightly coupled technology API:

  • An application needs to be operational whether or not all components are up and running simultaneously .

  • An application enables a component to send information to another component and continues to operate without receiving an immediate response.

  • The application's components are prone to change frequently; hence other interoperating components should minimize knowledge of the interfaces as much as possible.

You will find the concept of messaging very prevalent in manufacturing systems, financial services applications, health services applications, auctioning and community-based trading, workflow systems, supply-chain systems, and many others that need to leverage loosely coupled and asynchronous communication.

Also, with the industrywide adoption of XML, there are several organizations and industry consortia working on developing common XML DTDs and schemas for e-commerce interchange. In fact, BEA WebLogic Integration (WLI) includes B2Bi and Business Process Management (BPM) functionality based largely on XML delivered over JMS. To learn more about the features and capabilities of WebLogic Integration, see Chapter 33, "Introducing WebLogic Integration (WLI)."



BEA WebLogic Platform 7
BEA WebLogic Platform 7
ISBN: 0789727129
EAN: 2147483647
Year: 2003
Pages: 360

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