U S I N G T H E J M S A P I
Chapter
11
11. Using the JMS API
Messaging Service for Asynchronous Calls by Hiram
Chirino
The JMS API stands for Java Message Service Application Programming Interface, and it
is used by applications to send asynchronous business quality messages to other
applications. In the JMS world, messages are not sent directly to other applications.
Instead, messages are sent to destinations, also known as queues or topics . The
applications sending messages do not need to worry if the receiving applications are up and
running, and conversely, receiving applications do not need to worry about the sending
application's status. Both senders, and receivers only interact with the destinations.
The JMS API is the standardized interface to a JMS provider, sometimes called a Message
Oriented Middleware (MOM) system. JBoss comes a with JMS 1.0.2b compliant JMS
provider called JBossMQ. When you use the JMS API with JBoss, you are using the
JBossMQ engine transparently. JBossMQ implements the JMS spec fully, and adds few
extra features, so the best JBossMQ user guide is the JMS specification! For more
information about the JMS API please visit the
JMS Tutorial
or
JMS Downloads &
Specifications
. This rest of this chapter will assume you are already familiar with JMS
and it will mainly cover all the JBoss specifics.
Using JMS with JBoss
Looking up the ConnectionFactory
To use JMS in a client application, it is recommended that JNDI
8
be used to locate the JMS
ConnectionFactory objects that create connections to the JBoss JMS provider, JBossMQ.
Most standalone JMS client applications
9
should use the OIL invocation protocol. The OIL
uses and optimized socket protocol to communicate with the server. Listing 11 1, looking up
8
More information about the Java Naming and Directory Services (JNDI) can be found at the java.sun.com web site.
9
A standalone JMS client application is considered to be one that does not run inside the JBoss application server.
101
footer
Our partners:
PHP: Hypertext Preprocessor Cheap Web Hosting
JSP Web Hosting
Ontario Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Java Hosting
Cheapest Hosting
Visionwebhosting.net Business web hosting division of Vision Web Hosting Inc.. All rights reserved