Sessions in the PubSub+ JCSMP API
When a context is established, one or more sessions can be created within that context. A session creates a single, client connection to an event broker for sending and receiving messages.
A session provides the following primary services:
- client connection
- update and retrieve session properties
- retrieve session statistics
- add and remove subscriptions
- create destinations and endpoints
- publish and receive Direct messages
- publish Guaranteed messages
- make requests/replies or create requestors
- create Guaranteed message flows to receive Guaranteed messages
- create Browsers
- create cache sessions
When configuring a session, the following must be provided:
- Session properties to define the operating characteristics of the client connection to the event broker.
- A message callback for Direct messages that are received.
- An event handling callback for events that occur for the session (optional for JCSMP).
In the PubSub+ JCSMP API, the interface used for creating sessions is com.solacesystems.jcsmp.JCSMPSession
.
The figure below shows some of the fundamental processing components that are dependent on a session.
Session and its Aggregates