Information Technology Reference
In-Depth Information
Request Channel
Client
Requester
Server
Responder
Reply Channel
Figure 5.7.
JMS request/reply pattern.
5.5 JMS Protocol Implementation
The Java Messaging System (JMS) [47] is a Java API for accessing Message-
Oriented Middleware (MOM) systems. JMS is supported by most enterprise mes-
saging vendors and, as JMS is part of the Java Enterprise Edition (JEE) spec-
ification, it is supported by all JEE vendors. JMS is an asynchronous protocol
that provides both Topics, for publish/subscribe type interactions, and Queues,
for point-to-point interactions.
Our implementation supports point-to-point interactions using the JMS re-
quest/reply pattern [50], illustrated in Figure 5.7, which sends a request message
to a server via a send queue and awaits a response on a receive queue.
5.5.1
JMS Protocol Implementation Overview
To simplify implementation and to provide a multithread container that can sup-
port multiple simultaneous client requests, we use the following JMS features from
the Spring Framework [53] in our implementation:
•The JmsTemplate class for JMS client (message sending and receiving) fea-
tures.
•The SessionAwareMessageListener , which provides a multithreaded JMS
messaging container.
The JMS implementation is contained in a single class, JMSProtocol ,which
extends from the abstract Protocol class and supports the following options:
initialContextFactory. The JMS JNDI [100] context that is used to obtain access to
the JMS implementation.
persist. If defined and set to 'true', persistent messages are used for both receiving
and sending.
sendQueue. Thenameofthequeueusedtosendmessages.
receiveQueue. The name of the queue to receive message responses. If the name is
defined as the special name, temporary , a temporary queue is created.
servers. A comma-separated list defining the address of one or more JMS mes-
sage brokers in the format required by the underlying JMS implementa-
tion (usually a URL). In common with the RMI protocol, if defined it is
 
Search WWH ::




Custom Search