A session is a single threaded context for sending and receiving messages.
IBM.XMS.IPropertyContext | +----IBM.XMS.ISession
For a list of the XMS defined properties of a Session object, see Properties of Session.
.NET property | Description |
---|---|
AcknowledgeMode | Get the acknowledgement mode for the session. |
Transacted | Determine whether the session is transacted. |
AcknowledgeMode AcknowledgeMode { get; }
Get the acknowledgement mode for the session.
The acknowledgement mode is specified when the session is created.
Provided the session is not transacted, the acknowledgement mode is one of the following values:
For more information about acknowledgement modes, see Message acknowledgement.
A session that is transacted has no acknowledgement mode. If the session is transacted, the method returns AcknowledgeMode.SessionTransacted instead.
Method | Description |
---|---|
Close | Close the session. |
Commit | Commit all messages processed in the current transaction. |
CreateBrowser | Create a queue browser for the specified queue. |
CreateBrowser | Create a queue browser for the specified queue using a message selector. |
CreateBytesMessage | Create a bytes message. |
CreateConsumer | Create a message consumer for the specified destination. |
CreateConsumer | Create a message consumer for the specified destination using a message selector. |
CreateConsumer | Create a message consumer for the specified destination using a message selector and, if the destination is a topic, specifying whether the message consumer receives the messages published by its own connection. |
CreateDurableSubscriber | Create a durable subscriber for the specified topic. |
CreateDurableSubscriber | Create a durable subscriber for the specified topic using a message selector and specifying whether the durable subscriber receives the messages published by its own connection. |
CreateMapMessage | Create a map message. |
CreateMessage | Create a message that has no body. |
CreateObjectMessage | Create an object message. |
CreateProducer | Create a message producer to send messages to the specified destination. |
CreateQueue | Create a Destination object to represent a queue in the messaging server. |
CreateStreamMessage | Create a stream message. |
CreateTemporaryQueue | Create a temporary queue. |
CreateTemporaryTopic | Create a temporary topic. |
CreateTextMessage | Create a text message with an empty body. |
CreateTextMessage | Create a text message whose body is initialized with the specified text. |
CreateTopic | Create a Destination object to represent a topic. |
Recover | Recover the session. |
Rollback | Rollback all messages processed in the current transaction. |
Unsubscribe | Delete a durable subscription. |
IQueueBrowser CreateBrowser(IDestination queue, String selector) ;
Create a queue browser for the specified queue using a message selector.
A null String object means that there is no message selector for the queue browser.
IMessageConsumer CreateConsumer(IDestination dest, String selector) ;
Create a message consumer for the specified destination using a message selector.
A null String object means that there is no message selector for the message consumer.
IMessageConsumer CreateConsumer(IDestination dest, String selector, Boolean noLocal) ;
Create a message consumer for the specified destination using a message selector and, if the destination is a topic, specifying whether the message consumer receives the messages published by its own connection.
A null String object means that there is no message selector for the message consumer.
IMessageConsumer CreateDurableSubscriber(IDestination dest, String subscription) ;
Create a durable subscriber for the specified topic.
This method is not valid for a real-time connection to a broker.
For more information about durable subscribers, see Durable subscribers.
IMessageConsumer CreateDurableSubscriber(IDestination dest, String subscription, String selector, Boolean noLocal) ;
Create a durable subscriber for the specified topic using a message selector and specifying whether the durable subscriber receives the messages published by its own connection.
This method is not valid for a real-time connection to a broker.
For more information about durable subscribers, see Durable subscribers.
A null String object means that there is no message selector for the durable subscriber.
IMessageProducer CreateProducer(IDestination dest) ;
Create a message producer to send messages to the specified destination.
If you specify a null Destination object, the message producer is created without a destination. In this case, the application must specify a destination every time it uses the message producer to send a message.
IDestination CreateQueue(String queue) ;
Create a Destination object to represent a queue in the messaging server.
This method does not create the queue in the messaging server. You must create the queue before an application can call this method.
IDestination CreateTemporaryQueue() ;
The scope of the temporary queue is the connection. Only the sessions created by the connection can use the temporary queue.
The temporary queue remains until it is explicitly deleted, or the connection ends, whichever is the sooner.
For more information about temporary queues, see Temporary destinations.
IDestination CreateTemporaryTopic() ;
The scope of the temporary topic is the connection. Only the sessions created by the connection can use the temporary topic.
The temporary topic remains until it is explicitly deleted, or the connection ends, whichever is the sooner.
For more information about temporary topics, see Temporary destinations.
ITextMessage CreateTextMessage(String initialValue);
Create a text message whose body is initialized with the specified text.
IDestination CreateTopic(String topic) ;
Create a Destination object to represent a topic.
void Recover();
Recover the session. Message delivery is stopped and then restarted with the oldest unacknowledged message.
The session must not be a transacted session.
For more information about recovering a session, see Message acknowledgement.
void Unsubscribe(String subscription);
Delete a durable subscription. The messaging server deletes the record of the durable subscription that it is maintaining and does not send any more messages to the durable subscriber.
This method is not valid for a real-time connection to a broker.