background image

What Is the JMS API

<< The Java Message Service API | Messaging in an Enterprise Application >>
<< The Java Message Service API | Messaging in an Enterprise Application >>

What Is the JMS API

However, the sender and the receiver do not have to be available at the same time in order to
communicate. In fact, the sender does not need to know anything about the receiver; nor does
the receiver need to know anything about the sender. The sender and the receiver need to know
only which message format and which destination to use. In this respect, messaging differs from
tightly coupled technologies, such as Remote Method Invocation (RMI), which require an
application to know a remote application's methods.
Messaging also differs from electronic mail (email), which is a method of communication
between people or between software applications and people. Messaging is used for
communication between software applications or software components.
What Is the JMS API?
The Java Message Service is a Java API that allows applications to create, send, receive, and read
messages. Designed by Sun and several partner companies, the JMS API defines a common set
of interfaces and associated semantics that allow programs written in the Java programming
language to communicate with other messaging implementations.
The JMS API minimizes the set of concepts a programmer must learn in order to use messaging
products but provides enough features to support sophisticated messaging applications. It also
strives to maximize the portability of JMS applications across JMS providers in the same
messaging domain.
The JMS API enables communication that is not only loosely coupled but also
Asynchronous
: A JMS provider can deliver messages to a client as they arrive; a client does
not have to request messages in order to receive them.
Reliable
: The JMS API can ensure that a message is delivered once and only once. Lower
levels of reliability are available for applications that can afford to miss messages or to
receive duplicate messages.
The JMS specification was first published in August 1998. The latest version is Version 1.1,
which was released in April 2002. You can download a copy of the specification from the JMS
web site:
http://java.sun.com/products/jms/
.
When Can You Use the JMS API?
An enterprise application provider is likely to choose a messaging API over a tightly coupled
API, such as remote procedure call (RPC), under the following circumstances.
The provider wants the components not to depend on information about other
components' interfaces, so that components can be easily replaced.
The provider wants the application to run whether or not all components are up and
running simultaneously.
Overview of the JMS API
The Java EE 5 Tutorial · September 2007
894