Java Reference
In-Depth Information
Messaging
Some of the problems introduced by caches and their maintenance can be addressed with mes-
saging. Actually, used together, this is a one-two punch combination that can really improve
the robustness, dependability, and performance of your service-based systems.
Synchronous communications (such as the request/response-based system of the Web) are fre-
quently required. They are simple from a user standpoint and from an architectural standpoint.
But they can also tie up resources under heavy load, and forego a degree of reliability.
Standards-based messaging systems, such as JMS, can scale very, very well. Because they are
asynchronous as opposed to synchronous, they do not send a request and wait for an imme-
diate response. Email is a form of asynchronous communication, whereas a telephone call is
synchronous. Because the two sides of the line are not tied up concurrently, in asynchronous
communication the system is free to perform the work with the highest priority and provide a
timely response. Generally, of course, this happens very fast.
Your service can post to a messaging system, or be directly invoked over JMS, and if a reply
is required, there are a few different ways clients can receive their reply. You can employ the
JMS Reply-To mechanism, and set up a second queue as the destination for the initial queue
to deliver its reply messages.
Clients can then poll the queue to check for messages. You can also use the message selector
feature of JMS to narrow down the list of potential messages a client will receive.
Search WWH ::




Custom Search