ISession
A session is a single threaded context for sending and receiving messages.
- Inheritance hierarchy:
-
IBM.XMS.IPropertyContext | +----IBM.XMS.ISession
For a list of the XMS defined properties of a Session object, see Properties of Session.
Parent topic: .NET interfaces.NET properties
- Summary of .NET properties:
-
.NET property Description AcknowledgeMode Get the acknowledgment mode for the session. Transacted Determine whether the session is transacted.
Get the acknowledgment
mode for the session. The acknowledgment mode is specified
when the session is created. Provided the session is not transacted,
the acknowledgment mode is one of the following values:
For more information about acknowledgment modes, see Message
acknowledgment. A session that is transacted has no acknowledgment mode. If the session is transacted, the method
returns AcknowledgeMode.SessionTransacted instead.
Determine whether
the session is transacted. The transacted stated is:
For a real-time connection to a broker, the method always returns False.
Close the session. If
the session is transacted, any transaction in progress is rolled back. If
an application tries to close a session that is already closed, the
call is ignored.
Commit all messages
processed in the current transaction. The session must
be a transacted session.
Create a queue browser
for the specified queue.
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.
Create a bytes message.
Create a message consumer
for the specified destination.
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.
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.
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.
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.
Create a map message.
Create a message that
has no body.
Create an object message.
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.
Create a Destination
object to represent a queue in the messaging server. This
method does not create the queue in the messaging server. We must
create the queue before an application can call this method.
Create a stream message.
Create a temporary
queue. 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.
Create a temporary
topic. 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.
Create a text message
with an empty body.
Create a text message
whose body is initialized with the specified text.
None
Create a Destination
object to represent a topic.
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
acknowledgment.
Roll back all messages
processed in the current transaction. The session must
be a transacted session.
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.
AcknowledgeMode - Get Acknowledgement Mode
AcknowledgeMode AcknowledgeMode
{
get;
}
Transacted - Determine Whether Transacted
Boolean Transacted
{
get;
}
Methods
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
Roll back all messages
processed in the current transaction.
Unsubscribe
Delete a durable subscription.
Close - Close Session
void Close();
Commit - Commit
void Commit();
CreateBrowser - Create Queue Browser
IQueueBrowser CreateBrowser(IDestination queue) ;
CreateBrowser - Create Queue Browser (with message selector)
IQueueBrowser CreateBrowser(IDestination queue, String selector) ;
CreateBytesMessage - Create Bytes Message
IBytesMessage CreateBytesMessage();
CreateConsumer - Create Consumer
IMessageConsumer CreateConsumer(IDestination dest) ;
CreateConsumer - Create Consumer (with message selector)
IMessageConsumer CreateConsumer(IDestination dest,
String selector) ;
CreateConsumer - Create Consumer (with message selector
and local message flag)
IMessageConsumer CreateConsumer(IDestination dest,
String selector,
Boolean noLocal) ;
CreateDurableSubscriber - Create Durable Subscriber
IMessageConsumer CreateDurableSubscriber(IDestination dest,
String subscription) ;
CreateDurableSubscriber - Create Durable Subscriber (with
message selector and local message flag)
IMessageConsumer CreateDurableSubscriber(IDestination dest,
String subscription,
String selector,
Boolean noLocal) ;
CreateMapMessage - Create Map Message
IMapMessage CreateMapMessage();
CreateMessage - Create Message
IMessage CreateMessage();
CreateObjectMessage - Create Object Message
IObjectMessage CreateObjectMessage();
CreateProducer - Create Producer
IMessageProducer CreateProducer(IDestination dest) ;
CreateQueue - Create Queue
IDestination CreateQueue(String queue) ;
CreateStreamMessage - Create Stream Message
IStreamMessage CreateStreamMessage();
CreateTemporaryQueue - Create Temporary Queue
IDestination CreateTemporaryQueue() ;
CreateTemporaryTopic - Create Temporary Topic
IDestination CreateTemporaryTopic() ;
CreateTextMessage - Create Text Message
ITextMessage CreateTextMessage();
CreateTextMessage - Create Text Message (initialized)
ITextMessage CreateTextMessage(String initialValue);
CreateTopic - Create Topic
IDestination CreateTopic(String topic) ;
Recover - Recover
void Recover();
Rollback - Rollback
void Rollback();
Unsubscribe - Unsubscribe
void Unsubscribe(String subscription);
Inherited properties and methods
The following methods are inherited from the IPropertyContext interface: