The JMS context
AJMS contextis the main interface in the simplified JMS API introduced for JMS 2.0. This adds the functionality of two different objects from the JMS 1.1 API--a connectionand a session in a single object.
When an application needs to send messages, we need to use thecreateProducer
method to create aJMSProducer
, which provides methods to configure and send messages. Messages may be sent either synchronously or asynchronously.
When an application needs to receive messages, we need to use one of the severalcreateConsumer
orcreateDurableConsumer
methods to create aJMS consumer. AJMS consumerprovides methods to receive messages either synchronously or asynchronously.
According to the JMS 1.1 API, aJMS contextshould be thought of as representing both a connectionand a session. Although the simplified API removes the need for applications to use those objects, the concepts of connection and session remain important. A connection represents a physical link to the JMS server, and a session...