![]() |
Habari STOMP Client for RabbitMQ 9.4
Object Pascal STOMP client library for RabbitMQ
|
Represents a single unit of work on an IConnection. More...
Public Member Functions | |
Close () | |
Closes the session. | |
Commit () | |
If this is a transactional session then commit all message send and acknowledgements for producers and consumers in this session. | |
IBytesMessage | CreateBytesMessage () |
Creates an IBytesMessage object. | |
IMessageConsumer | CreateConsumer (const IDestination Destination) |
Creates an IMessageConsumer for the specified destination. | |
IMessageConsumer | CreateConsumer (const IDestination Destination, const string MessageSelector) |
Creates an IMessageConsumer for the specified destination, using a message selector. | |
IMessageConsumer | CreateConsumer (const IDestination Destination, const string MessageSelector, const Boolean NoLocal) |
Creates an IMessageConsumer for the specified destination, using a message selector. | |
ITopicSubscriber | CreateDurableSubscriber (const ITopic Topic, const string Name) |
Creates a durable subscriber to the specified topic. | |
ITopicSubscriber | CreateDurableSubscriber (const ITopic Topic, const string Name, const string MessageSelector, const Boolean NoLocal) |
Creates a durable subscriber to the specified topic, using a message selector and specifying whether messages published by its own connection should be delivered to it. | |
IMessage | CreateMessage () |
Creates an IMessage object. | |
IMessageProducer | CreateProducer (const IDestination Destination) |
Creates a producer of messages on a given destination. | |
IQueue | CreateQueue (const string QueueName) |
Creates a queue identity given an IQueue name. | |
ITemporaryQueue | CreateTemporaryQueue () |
Creates an ITemporaryQueue object. | |
ITemporaryTopic | CreateTemporaryTopic () |
Creates an ITemporaryTopic object. | |
IObjectMessage | CreateObjectMessage () |
Creates an IObjectMessage object. | |
IObjectMessage | CreateObjectMessage (const TObject AObject) |
Creates an initialized IObjectMessage object. | |
ITextMessage | CreateTextMessage () |
Creates an ITextMessage object. | |
IMapMessage | CreateMapMessage () |
Creates an IMapMessage object. | |
ITextMessage | CreateTextMessage (const string Text) |
Creates an initialized ITextMessage object. | |
ITopic | CreateTopic (const string TopicName) |
Creates a topic identity given an ITopic name. | |
Rollback () | |
If this is a transactional session then rollback all message send and acknowledgements for producers and consumers in this session. | |
Unsubscribe (const string Destination, const string Name) | |
Unsubscribes a durable subscription that has been created by a client. | |
Broker-specific notes | |
These methods are only supported by ActiveMQ and Artemis. | |
IQueueBrowser | CreateBrowser (const string QueueName) |
Creates an IQueueBrowser object to peek at the messages on the specified queue. |
Public Attributes | |
TAcknowledgementMode | AcknowledgeMode |
Returns the acknowledgement mode of the session. | |
Boolean | Transacted |
Indicates whether the session is in transacted mode. |
Represents a single unit of work on an IConnection.
A Session object is a single-threaded context for producing and consuming messages.
A session serves several purposes:
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's IMessageProducers.
If a client desires to have one thread produce messages while others consume them, the client should use a separate connection for its producing thread.
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.
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.
ISession::Close | ( | ) |
Closes the session.
ISession::Commit | ( | ) |
If this is a transactional session then commit all message send and acknowledgements for producers and consumers in this session.
EMQException | if the session is not transacted |
IQueueBrowser ISession::CreateBrowser | ( | const string | QueueName | ) |
Creates an IQueueBrowser object to peek at the messages on the specified queue.
This feature requires STOMP 1.1
IBytesMessage ISession::CreateBytesMessage | ( | ) |
Creates an IBytesMessage object.
An IBytesMessage object is used to send a message containing a stream of uninterpreted bytes.
IMessageConsumer ISession::CreateConsumer | ( | const IDestination | Destination | ) |
Creates an IMessageConsumer for the specified destination.
Since IQueue and ITopic both inherit from IDestination, they can be used in the destination parameter to create an IMessageConsumer.
Destination | the IDestination to access. |
IMessageConsumer ISession::CreateConsumer | ( | const IDestination | Destination, |
const string | MessageSelector ) |
Creates an IMessageConsumer for the specified destination, using a message selector.
Since IQueue and ITopic both inherit from IDestination, they can be used in the destination parameter to create a IMessageConsumer.
A client uses an IMessageConsumer object to receive messages that have been sent to a destination.
Destination | the IDestination to access |
MessageSelector | only messages with properties matching the message selector expression are delivered. An empty string indicates that there is no message selector for the message consumer. |
IMessageConsumer ISession::CreateConsumer | ( | const IDestination | Destination, |
const string | MessageSelector, | ||
const Boolean | NoLocal ) |
Creates an IMessageConsumer for the specified destination, using a message selector.
This method can specify whether messages published by its own connection should be delivered to it, if the destination is a topic.
Since IQueue and ITopic both inherit from IDestination, they can be used in the destination parameter to create an IMessageConsumer.
A client uses an IMessageConsumer object to receive messages that have been published to a destination.
In some cases, a connection may both publish and subscribe to a topic. The consumer noLocal
attribute allows a consumer to inhibit the delivery of messages published by its own connection. The default value for this attribute is False.
Destination | the IDestination to access |
MessageSelector | only messages with properties matching the message selector expression are delivered. An empty string indicates that there is no message selector for the message consumer. |
NoLocal | - if true, and the destination is a topic, inhibits the delivery of messages published by its own connection. The behavior for NoLocal is not specified if the destination is a queue. |
ITopicSubscriber ISession::CreateDurableSubscriber | ( | const ITopic | Topic, |
const string | Name ) |
Creates a durable subscriber to the specified topic.
Topic | - the non-temporary ITopic to subscribe to |
Name | - the name used to identify this subscription |
EMQException | if the session fails to create a subscriber due to some internal error. |
ITopicSubscriber ISession::CreateDurableSubscriber | ( | const ITopic | Topic, |
const string | Name, | ||
const string | MessageSelector, | ||
const Boolean | NoLocal ) |
Creates a durable subscriber to the specified topic, using a message selector and specifying whether messages published by its own connection should be delivered to it.
Topic | - the non-temporary ITopic to subscribe to |
Name | - the name used to identify this subscription |
MessageSelector | only messages with properties matching the message selector expression are delivered. An empty string indicates that there is no message selector for the message consumer. |
NoLocal | - if true, and the destination is a topic, inhibits the delivery of messages published by its own connection. The behavior for NoLocal is not specified if the destination is a queue. |
IMapMessage ISession::CreateMapMessage | ( | ) |
Creates an IMapMessage object.
An IMapMessage object is used to send a self-defining set of name-value pairs, where names are String objects and values are primitive values in the Java programming language.
IMessage ISession::CreateMessage | ( | ) |
IObjectMessage ISession::CreateObjectMessage | ( | ) |
Creates an IObjectMessage object.
An IObjectMessage object is used to send a message that contains a serializable object.
IObjectMessage ISession::CreateObjectMessage | ( | const TObject | AObject | ) |
Creates an initialized IObjectMessage object.
An IObjectMessage object is used to send a message that contains a serializable object.
AObject | the object to use to initialize this message |
IMessageProducer ISession::CreateProducer | ( | const IDestination | Destination | ) |
Creates a producer of messages on a given destination.
IQueue ISession::CreateQueue | ( | const string | QueueName | ) |
ITemporaryQueue ISession::CreateTemporaryQueue | ( | ) |
Creates an ITemporaryQueue object.
Its lifetime will be that of the Connection unless it is deleted earlier.
ITemporaryTopic ISession::CreateTemporaryTopic | ( | ) |
Creates an ITemporaryTopic object.
Its lifetime will be that of the Connection unless it is deleted earlier.
ITextMessage ISession::CreateTextMessage | ( | ) |
Creates an ITextMessage object.
An ITextMessage object is used to send a message containing a String object.
ITextMessage ISession::CreateTextMessage | ( | const string | Text | ) |
Creates an initialized ITextMessage object.
An ITextMessage object is used to send a message containing a String.
Text | the string used to initialize this message |
ITopic ISession::CreateTopic | ( | const string | TopicName | ) |
ISession::Rollback | ( | ) |
If this is a transactional session then rollback all message send and acknowledgements for producers and consumers in this session.
EMQException | if the session is not transacted |
ISession::Unsubscribe | ( | const string | Destination, |
const string | Name ) |
Unsubscribes a durable subscription that has been created by a client.
Destination | - the destination name |
Name | - the name used to identify this subscription |
EMQException | if the session fails to unsubscribe to the durable subscription due to some internal error. |
TAcknowledgementMode ISession::AcknowledgeMode |
Returns the acknowledgement mode of the session.
The acknowledgement mode is set at the time that the session is created.
Boolean ISession::Transacted |
Indicates whether the session is in transacted mode.