Sessions
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
- create Guaranteed message flows to receive Guaranteed messages
- create browsers (for the PubSub+ .NET API only)
- 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.
PubSub+ Messaging API | Use |
---|---|
PubSub+ Java RTO API |
|
PubSub+ C API |
|
PubSub+ .NET API |
|
PubSub+ JavaScript API and PubSub+ Node.js API |
|
The figure below shows some of the fundamental processing components that are dependent on a session.
Session and its Aggregates
Handles
Handles are used in the PubSub+ Java RTO API. The PubSub+ Java RTO API is an implementation of Java Native Interface (JNI)-wrapped C, and is essentially an object-oriented abstraction of the PubSub+ C API.
A handle is a Java interface representing a C object. Handles are created by Solclient.Allocator
and are unbound (not associated with any C object) when created. Handles can be bound to (associated with) a C object through the PubSub+ Java RTO API.
When a handle is bound to a C object, that C object can be manipulated through the PubSub+ Java RTO API.
Handles have the word Handle
appended to their class name, as in ContextHandle
or MessageHandle
.