Information Technology Reference
In-Depth Information
5.5.2 Java Message Service (JMS)
As indicated earlier, applications that were designed for use with one
middleware product could not be used with another middleware product.
Middleware vendors attempted to standardize programming interfaces
to MOM packages, but with little success. In 1999, Sun launched the Java
Message Service (JMS), a framework that specified a set of programming
interfaces by which Java programs could access MOM software. JMS is not
a messaging system itself; it is an abstraction of the interfaces and classes
needed by messaging clients when communicating with different messag-
ing systems. JMS is a vendor-independent API for enterprise messaging
that can be used with many different MOM vendors. JMS acts as a wrap-
per around different messaging products, allowing developers to focus on
actual application development and integration, rather on the particulars of
each other's APIs; application developers use the same API to access many
different systems. JMS not only provides a Java API for connectivity to MOM
systems but also supports messaging as a first-class Java distributed comput-
ing paradigm on the same footing as RPC. JMS-based communication is a
potential solution in any distributed computing scenario that needs to pass
data either synchronously or asynchronously between application elements,
for instance; interfacing Enterprise Java Beans (EJB) with legacy applications
and sending legacy-related data between the two.
JMS provides two principal models of MOM messaging:
1. The JMS point-to-point messaging model allows JMS clients to send
and receive messages both asynchronously and synchronously
via queues. A given queue may have multiple receivers, but only
one receiver may consume each message. This guarantees that, for
example, if a packaging order is sent to multiple warehouses, a sin-
gle warehouse receives the message and processes the order.
2. The JMS publish/subscribe messaging model allows publishers to
send messages to a named topic; all subscribers to this topic receive
all messages sent to this topic. There may be multiple message listen-
ers subscribed to each topic and an application can be both sender
and receiver. JMS supports different message-sending configura-
tions, including one-to-one messages, one-to-many messages, and
many-to-many messages. One-to-one messages allow one message
to be sent from one publisher (sender) to one subscriber (receiver),
that is, point-to-point messaging; one-to-many messages allow one
message to be sent from one publisher to numerous subscribers;
and many-to-many messages allow many messages to be sent from
many publishers to numerous subscribers.
JMS supports two types of message delivery: reliable message delivery and
guaranteed message delivery. With reliable message delivery, the messaging
Search WWH ::




Custom Search