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.