The Java Message Service (JMS) is message-oriented middleware that enables asynchronous, distributed messaging. The JMS 1.1 specification is available on the Sun Developers Network at http://java.sun.com/products/jms.
In JMS messaging, an application creates a connection, then establishes one or more sessions on the connection. Message producers send messages to destinations. Message consumers receive messages from destinations.
The flow of objects is shown in this sequence diagram:
As illustrated, a ConnectionFactory creates a Connection and then calls the
start method. A Session is created in the context of a Connection.
MessageProducer and MessageConsumer functions
act on messages in the context of a Session.









