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 (or create Requestors for JCSMP)
  • create Guaranteed message Flows to receive Guaranteed messages
  • create Browsers (for the JCSMP and .NET APIs 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 (optional for JCSMP).

Session APIs

PubSub+ Messaging API Use

JCSMP

com.solacesystems.jcsmp.JCSMPSession

Java RTO

com.solacesystems.solclientj.core.
handle.SessionHandle

C

solClient_opaqueSession_pt

solClient_session_create(...)

.NET

SolaceSystems.Solclient.Messaging.
ISession

JavaScript and Node.js

solace.Session

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 Java RTO API. The Java RTO API is an implementation of Java Native Interface (JNI)-wrapped C, and is essentially an object-oriented abstraction of the 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 Java RTO API.

When a Handle is bound to a C object, that C object can be manipulated through the Java RTO API.

Handles have the word Handle appended to their class name, as in ContextHandle or MessageHandle.