Java Reference
In-Depth Information
Chapter 7. Developing
Applications
with JBoss JMS Provider
Messaging is a method of communication between software components and ap-
plications. The Java Message Service ( JMS ) documented at http://java.sun.com/
products/jms/docs.html is a Java API designed by Sun that allows applications to cre-
ate, send, receive, and read messages.
Messaging differs from other standard protocols, such as Remote Method Invoca-
tion ( RMI ) or Hypertext Transfer Protocol ( HTTP ), in two ways. First, the conversa-
tion is mediated by a messaging server, so it's not a two-way conversation between
peers. Second, the sender and the receiver need to know what message format and
what destination to use. This is in contrast to tightly coupled technologies, such as
Remote Method Invocation ( RMI ), which require an application to know a remote
application's methods.
In this chapter, we will cover:
• A brief introduction to message-oriented systems
• The building blocks of the JBoss messaging subsystem
• Setting up some proof of concept programming examples
• How to use JMS and resource adapters to integrate with external systems
A short introduction to JMS
JMS defines a vendor-neutral (but Java-specific) set of programming interfaces for
interacting with asynchronous messaging systems. Messaging enables distributed
communication that is loosely coupled. The whole messaging interchange is a two-
step process: where, a component sends a message to a destination, which is in turn
retrieved by the recipient with the mediation of the JMS server. In JMS, there are two
types of destinations: topics and queues. These have different semantics, which are
explained next.
In the point-to-point model, messages are sent from producers to consumers via
queues . A given queue may have multiple receivers but only one receiver may con-
Search WWH ::




Custom Search