Interface ISession
Represents a single unit of work on an IConnection.
So the ISession can be used to perform transactional receive and sends
Inherited Members
System.IDisposable.Dispose()
Assembly: Apache.NMS.dll
Syntax
public interface ISession : IDisposable
Properties
|
Improve this Doc
View Source
AcknowledgementMode
Declaration
AcknowledgementMode AcknowledgementMode { get; }
Property Value
|
Improve this Doc
View Source
A Delegate that is called each time a Message is dispatched to allow the client to do
any necessary transformations on the received message before it is delivered.
The Session instance sets the delegate on each Consumer it creates.
Declaration
ConsumerTransformerDelegate ConsumerTransformer { get; set; }
Property Value
|
Improve this Doc
View Source
A delegate that is called each time a Message is sent from this Producer which allows
the application to perform any needed transformations on the Message before it is sent.
The Session instance sets the delegate on each Producer it creates.
Declaration
ProducerTransformerDelegate ProducerTransformer { get; set; }
Property Value
|
Improve this Doc
View Source
RequestTimeout
Declaration
TimeSpan RequestTimeout { get; set; }
Property Value
Type |
Description |
System.TimeSpan |
|
|
Improve this Doc
View Source
Transacted
Declaration
Property Value
Type |
Description |
System.Boolean |
|
Methods
|
Improve this Doc
View Source
Acknowledge()
Declaration
|
Improve this Doc
View Source
Close()
Closes the session. There is no need to close the producers and consumers
of a closed session.
Declaration
|
Improve this Doc
View Source
Commit()
If this is a transactional session then commit all message
send and acknowledgements for producers and consumers in this session
Declaration
|
Improve this Doc
View Source
CreateBrowser(IQueue)
Creates a QueueBrowser object to peek at the messages on the specified queue.
Declaration
IQueueBrowser CreateBrowser(IQueue queue)
Parameters
Returns
Exceptions
Type |
Condition |
System.NotSupportedException |
If the Prodiver does not support creation of Queue Browsers.
|
|
Improve this Doc
View Source
CreateBrowser(IQueue, String)
Creates a QueueBrowser object to peek at the messages on the specified queue
using a message selector.
Declaration
IQueueBrowser CreateBrowser(IQueue queue, string selector)
Parameters
Type |
Name |
Description |
IQueue |
queue |
A IQueue
|
System.String |
selector |
A System.String
|
Returns
Exceptions
Type |
Condition |
System.NotSupportedException |
If the Prodiver does not support creation of Queue Browsers.
|
|
Improve this Doc
View Source
CreateBytesMessage()
Creates a new binary message
Declaration
IBytesMessage CreateBytesMessage()
Returns
|
Improve this Doc
View Source
CreateBytesMessage(Byte[])
Creates a new binary message with the given body
Declaration
IBytesMessage CreateBytesMessage(byte[] body)
Parameters
Type |
Name |
Description |
System.Byte[] |
body |
|
Returns
|
Improve this Doc
View Source
CreateConsumer(IDestination)
Creates a consumer of messages on a given destination
Declaration
IMessageConsumer CreateConsumer(IDestination destination)
Parameters
Returns
|
Improve this Doc
View Source
CreateConsumer(IDestination, String)
Creates a consumer of messages on a given destination with a selector
Declaration
IMessageConsumer CreateConsumer(IDestination destination, string selector)
Parameters
Type |
Name |
Description |
IDestination |
destination |
|
System.String |
selector |
|
Returns
|
Improve this Doc
View Source
CreateConsumer(IDestination, String, Boolean)
Creates a consumer of messages on a given destination with a selector
Declaration
IMessageConsumer CreateConsumer(IDestination destination, string selector, bool noLocal)
Parameters
Type |
Name |
Description |
IDestination |
destination |
|
System.String |
selector |
|
System.Boolean |
noLocal |
|
Returns
|
Improve this Doc
View Source
CreateDurableConsumer(ITopic, String)
Declaration
IMessageConsumer CreateDurableConsumer(ITopic destination, string name)
Parameters
Type |
Name |
Description |
ITopic |
destination |
|
System.String |
name |
|
Returns
|
Improve this Doc
View Source
CreateDurableConsumer(ITopic, String, String)
Declaration
IMessageConsumer CreateDurableConsumer(ITopic destination, string name, string selector)
Parameters
Type |
Name |
Description |
ITopic |
destination |
|
System.String |
name |
|
System.String |
selector |
|
Returns
|
Improve this Doc
View Source
CreateDurableConsumer(ITopic, String, String, Boolean)
Creates a named durable consumer of messages on a given destination with a selector
Declaration
IMessageConsumer CreateDurableConsumer(ITopic destination, string name, string selector, bool noLocal)
Parameters
Type |
Name |
Description |
ITopic |
destination |
|
System.String |
name |
|
System.String |
selector |
|
System.Boolean |
noLocal |
|
Returns
|
Improve this Doc
View Source
CreateMapMessage()
Creates a new Map message which contains primitive key and value pairs
Declaration
IMapMessage CreateMapMessage()
Returns
|
Improve this Doc
View Source
CreateMessage()
Creates a new message with an empty body
Declaration
Returns
|
Improve this Doc
View Source
CreateObjectMessage(Object)
Creates a new Object message containing the given .NET object as the body
Declaration
IObjectMessage CreateObjectMessage(object body)
Parameters
Type |
Name |
Description |
System.Object |
body |
|
Returns
|
Improve this Doc
View Source
CreateProducer()
Creates a producer of messages
Declaration
IMessageProducer CreateProducer()
Returns
|
Improve this Doc
View Source
CreateProducer(IDestination)
Creates a producer of messages on a given destination
Declaration
IMessageProducer CreateProducer(IDestination destination)
Parameters
Returns
|
Improve this Doc
View Source
CreateSharedConsumer(ITopic, String)
Declaration
IMessageConsumer CreateSharedConsumer(ITopic destination, string name)
Parameters
Type |
Name |
Description |
ITopic |
destination |
|
System.String |
name |
|
Returns
|
Improve this Doc
View Source
CreateSharedConsumer(ITopic, String, String)
Declaration
IMessageConsumer CreateSharedConsumer(ITopic destination, string name, string selector)
Parameters
Type |
Name |
Description |
ITopic |
destination |
|
System.String |
name |
|
System.String |
selector |
|
Returns
|
Improve this Doc
View Source
CreateSharedDurableConsumer(ITopic, String)
Declaration
IMessageConsumer CreateSharedDurableConsumer(ITopic destination, string name)
Parameters
Type |
Name |
Description |
ITopic |
destination |
|
System.String |
name |
|
Returns
|
Improve this Doc
View Source
CreateSharedDurableConsumer(ITopic, String, String)
Declaration
IMessageConsumer CreateSharedDurableConsumer(ITopic destination, string name, string selector)
Parameters
Type |
Name |
Description |
ITopic |
destination |
|
System.String |
name |
|
System.String |
selector |
|
Returns
|
Improve this Doc
View Source
CreateStreamMessage()
Creates a new stream message
Declaration
IStreamMessage CreateStreamMessage()
Returns
|
Improve this Doc
View Source
CreateTemporaryQueue()
Creates a temporary queue
Declaration
ITemporaryQueue CreateTemporaryQueue()
Returns
|
Improve this Doc
View Source
CreateTemporaryTopic()
Creates a temporary topic
Declaration
ITemporaryTopic CreateTemporaryTopic()
Returns
|
Improve this Doc
View Source
CreateTextMessage()
Creates a new text message with an empty body
Declaration
ITextMessage CreateTextMessage()
Returns
|
Improve this Doc
View Source
CreateTextMessage(String)
Creates a new text message with the given body
Declaration
ITextMessage CreateTextMessage(string text)
Parameters
Type |
Name |
Description |
System.String |
text |
|
Returns
|
Improve this Doc
View Source
DeleteDestination(IDestination)
Delete a destination (Queue, Topic, Temp Queue, Temp Topic).
Declaration
void DeleteDestination(IDestination destination)
Parameters
|
Improve this Doc
View Source
DeleteDurableConsumer(String)
Deletes a durable consumer created with CreateDurableConsumer().
Declaration
[Obsolete("should use unsubscribe instead")]
void DeleteDurableConsumer(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
Name of the durable consumer
|
|
Improve this Doc
View Source
GetQueue(String)
Returns the queue for the given name
Declaration
IQueue GetQueue(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
|
Improve this Doc
View Source
GetTopic(String)
Returns the topic for the given name
Declaration
ITopic GetTopic(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Returns
|
Improve this Doc
View Source
Recover()
Stops all Message delivery in this session and restarts it again
with the oldest unabcknowledged message. Messages that were delivered
but not acknowledge should have their redelivered property set.
This is an optional method that may not by implemented by all NMS
providers, if not implemented an Exception will be thrown.
Message redelivery is not requried to be performed in the original
order. It is not valid to call this method on a Transacted Session.
Declaration
|
Improve this Doc
View Source
Rollback()
If this is a transactional session then rollback all message
send and acknowledgements for producers and consumers in this session
Declaration
|
Improve this Doc
View Source
Unsubscribe(String)
Declaration
void Unsubscribe(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
|
Events
|
Improve this Doc
View Source
TransactionCommittedListener
Declaration
event SessionTxEventDelegate TransactionCommittedListener
Event Type
|
Improve this Doc
View Source
TransactionRolledBackListener
Declaration
event SessionTxEventDelegate TransactionRolledBackListener
Event Type
|
Improve this Doc
View Source
TransactionStartedListener
Declaration
event SessionTxEventDelegate TransactionStartedListener
Event Type