Java Reference
In-Depth Information
Using the JMS API with Application Clients and Web Components
An application client in a Java EE application can use the JMS API in much the same
way that a stand-alone client program does. It can produce messages, and it can consume
messages by using either synchronous receives or message listeners. See Chapter 11 , “ A
Message-Driven Bean Example , ” for an example of an application client that produces
messages. For an example of using an application client to produce and to consume mes-
sages, see “ An Application Example That Deploys a Message-Driven Bean on Two Serv-
ers on page 436 .
The Java EE platform specification does not impose strict constraints on how web com-
ponents should use the JMS API. In the GlassFish Server, a web component can send mes-
sages and consume them synchronously but cannot consume them asynchronously.
Because a blocking synchronous receive ties up server resources, it is not a good program-
ming practice to use such a receive call in a web component. Instead, use a timed syn-
chronous receive. For details about blocking and timed synchronous receives, see “ Writ-
ing the Clients for the Synchronous Receive Example on page 378 .
Further Information about JMS
For more information about JMS, see:
• Java Message Service web site:
http://www.oracle.com/technetwork/java/index-
jsp-142945.html
• Java Message Service specification, version 1.1, available from:
http://www.oracle.com/technetwork/java/
docs-136352.html
Search WWH ::




Custom Search