43.1. Overview and Related Interfaces

A Session object is a single-threaded context for producing and consuming messages. Although it may allocate provider resources outside the Java virtual machine (JVM), it is considered a lightweight JMS object.

A session serves several purposes:

  • It is a factory for its message producers and consumers.

  • It supplies provider-optimized message factories.

  • It supports a single series of transactions that combine work spanning its producers and consumers into atomic units.

  • It defines a serial order for the messages it consumes and the messages it produces.

  • It retains messages it consumes until they have been acknowledged.

  • It serializes execution of message listeners registered with its message consumers.

A session can ...

Get Java™ Message Service API Tutorial and Reference: Messaging for the J2EE™ Platform now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.