Habari STOMP Client for RabbitMQ 7.2
Object Pascal STOMP client library for RabbitMQ
TBTAbstractSession Class Reference

A Session object is a single-threaded context for producing and consuming messages. More...

Inheritance diagram for TBTAbstractSession:

Public Attributes

TAcknowledgementMode AcknowledgeMode
 The acknowledgement mode of the session. More...
Boolean Running
 Returns True if the session has started. More...
Boolean Transacted
 Whether the session uses transactions. More...

Protected Member Functions

 CheckClosed ()
 Check if the session is closed. More...
 Start ()
 Start the Session.
 Stop ()
 Stops the session.

Detailed Description

A Session object is a single-threaded context for producing and consuming messages.

A session serves several purposes:

  • It is a factory for its message producers and consumers.
  • It supplies message factories.
  • It provides a way to create IQueue or ITopic objects.
  • It supports a single series of transactions.

A session can create and service multiple message producers and consumers.

One typical use is to have a thread block on a synchronous IMessageConsumer until a message arrives. The thread may then use one or more of the ISession'sIMessageProducers.

If a client desires to have one thread produce messages while others consume them, the client should use a separate session for its producing thread.

Once a connection has been started, any session with one or more registered message listeners is dedicated to the thread of control that delivers messages to it. It is erroneous for client code to use this session or any of its constituent objects from another thread of control.

It should be easy for most clients to partition their work naturally into sessions. This model allows clients to start simply and incrementally add message processing complexity as their need for concurrency grows.

The close method is the only session method that can be called while some other session method is being executed in another thread.

A session may be specified as transacted. Each transacted session supports a single series of transactions.

A transaction is completed using either its session's commit method or its session's rollback method. The completion of a session's current transaction automatically begins the next. The result is that a transacted session always has a current transaction within which its work is done.

Member Function Documentation

◆ CheckClosed()

TBTAbstractSession::CheckClosed ( )

Check if the session is closed.

It is used for ensuring that the session is open before performing various operations.

EIllegalStateExceptionif the Session is closed

Member Data Documentation

◆ AcknowledgeMode

TAcknowledgementMode TBTAbstractSession::AcknowledgeMode

The acknowledgement mode of the session.

See also
GetAcknowledgeMode For reading

◆ Running

Boolean TBTAbstractSession::Running

Returns True if the session has started.

See also
FStarted For reading

◆ Transacted

Boolean TBTAbstractSession::Transacted

Whether the session uses transactions.

See also
GetTransacted For reading