Show / Hide Table of Contents

    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()
    Namespace: Apache.NMS
    Assembly: Apache.NMS.dll
    Syntax
    public interface ISession : IDisposable

    Properties

    AcknowledgementMode

    Declaration
    AcknowledgementMode AcknowledgementMode { get; }
    Property Value
    Type Description
    AcknowledgementMode

    ConsumerTransformer

    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
    Type Description
    ConsumerTransformerDelegate

    ProducerTransformer

    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
    Type Description
    ProducerTransformerDelegate

    RequestTimeout

    Declaration
    TimeSpan RequestTimeout { get; set; }
    Property Value
    Type Description
    System.TimeSpan

    Transacted

    Declaration
    bool Transacted { get; }
    Property Value
    Type Description
    System.Boolean

    Methods

    Close()

    Closes the session. There is no need to close the producers and consumers of a closed session.

    Declaration
    void Close()

    Commit()

    If this is a transactional session then commit all message send and acknowledgements for producers and consumers in this session

    Declaration
    void Commit()

    CreateBrowser(IQueue)

    Creates a QueueBrowser object to peek at the messages on the specified queue.

    Declaration
    IQueueBrowser CreateBrowser(IQueue queue)
    Parameters
    Type Name Description
    IQueue queue

    A IQueue

    Returns
    Type Description
    IQueueBrowser

    A IQueueBrowser

    Exceptions
    Type Condition
    System.NotSupportedException

    If the Prodiver does not support creation of Queue Browsers.

    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
    Type Description
    IQueueBrowser

    A IQueueBrowser

    Exceptions
    Type Condition
    System.NotSupportedException

    If the Prodiver does not support creation of Queue Browsers.

    CreateBytesMessage()

    Creates a new binary message

    Declaration
    IBytesMessage CreateBytesMessage()
    Returns
    Type Description
    IBytesMessage

    CreateBytesMessage(Byte[])

    Creates a new binary message with the given body

    Declaration
    IBytesMessage CreateBytesMessage(byte[] body)
    Parameters
    Type Name Description
    System.Byte[] body
    Returns
    Type Description
    IBytesMessage

    CreateConsumer(IDestination)

    Creates a consumer of messages on a given destination

    Declaration
    IMessageConsumer CreateConsumer(IDestination destination)
    Parameters
    Type Name Description
    IDestination destination
    Returns
    Type Description
    IMessageConsumer

    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
    Type Description
    IMessageConsumer

    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
    Type Description
    IMessageConsumer

    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
    Type Description
    IMessageConsumer

    CreateMapMessage()

    Creates a new Map message which contains primitive key and value pairs

    Declaration
    IMapMessage CreateMapMessage()
    Returns
    Type Description
    IMapMessage

    CreateMessage()

    Creates a new message with an empty body

    Declaration
    IMessage CreateMessage()
    Returns
    Type Description
    IMessage

    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
    Type Description
    IObjectMessage

    CreateProducer()

    Creates a producer of messages

    Declaration
    IMessageProducer CreateProducer()
    Returns
    Type Description
    IMessageProducer

    CreateProducer(IDestination)

    Creates a producer of messages on a given destination

    Declaration
    IMessageProducer CreateProducer(IDestination destination)
    Parameters
    Type Name Description
    IDestination destination
    Returns
    Type Description
    IMessageProducer

    CreateStreamMessage()

    Creates a new stream message

    Declaration
    IStreamMessage CreateStreamMessage()
    Returns
    Type Description
    IStreamMessage

    CreateTemporaryQueue()

    Creates a temporary queue

    Declaration
    ITemporaryQueue CreateTemporaryQueue()
    Returns
    Type Description
    ITemporaryQueue

    CreateTemporaryTopic()

    Creates a temporary topic

    Declaration
    ITemporaryTopic CreateTemporaryTopic()
    Returns
    Type Description
    ITemporaryTopic

    CreateTextMessage()

    Creates a new text message with an empty body

    Declaration
    ITextMessage CreateTextMessage()
    Returns
    Type Description
    ITextMessage

    CreateTextMessage(String)

    Creates a new text message with the given body

    Declaration
    ITextMessage CreateTextMessage(string text)
    Parameters
    Type Name Description
    System.String text
    Returns
    Type Description
    ITextMessage

    DeleteDestination(IDestination)

    Delete a destination (Queue, Topic, Temp Queue, Temp Topic).

    Declaration
    void DeleteDestination(IDestination destination)
    Parameters
    Type Name Description
    IDestination destination

    DeleteDurableConsumer(String)

    Deletes a durable consumer created with CreateDurableConsumer().

    Declaration
    void DeleteDurableConsumer(string name)
    Parameters
    Type Name Description
    System.String name

    Name of the durable consumer

    GetQueue(String)

    Returns the queue for the given name

    Declaration
    IQueue GetQueue(string name)
    Parameters
    Type Name Description
    System.String name
    Returns
    Type Description
    IQueue

    GetTopic(String)

    Returns the topic for the given name

    Declaration
    ITopic GetTopic(string name)
    Parameters
    Type Name Description
    System.String name
    Returns
    Type Description
    ITopic

    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
    void Recover()

    Rollback()

    If this is a transactional session then rollback all message send and acknowledgements for producers and consumers in this session

    Declaration
    void Rollback()

    Events

    TransactionCommittedListener

    Declaration
    event SessionTxEventDelegate TransactionCommittedListener
    Event Type
    Type Description
    SessionTxEventDelegate

    TransactionRolledBackListener

    Declaration
    event SessionTxEventDelegate TransactionRolledBackListener
    Event Type
    Type Description
    SessionTxEventDelegate

    TransactionStartedListener

    Declaration
    event SessionTxEventDelegate TransactionStartedListener
    Event Type
    Type Description
    SessionTxEventDelegate
    Back to top Copyright © 2005-2019 Apache Software Foundation project
    Generated by DocFX