Show / Hide Table of Contents

    Interface IMessageConsumer

    A consumer of messages

    Inherited Members
    System.IDisposable.Dispose()
    Namespace: Apache.NMS
    Assembly: Apache.NMS.dll
    Syntax
    public interface IMessageConsumer : IDisposable

    Properties

    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.

    Declaration
    ConsumerTransformerDelegate ConsumerTransformer { get; set; }
    Property Value
    Type Description
    ConsumerTransformerDelegate

    Methods

    Close()

    Closes the message consumer.

    Declaration
    void Close()
    Remarks

    Clients should close message consumers them when they are not needed. This call blocks until a receive or message listener in progress has completed. A blocked message consumer receive call returns null when this message consumer is closed.

    Receive()

    Waits until a message is available and returns it

    Declaration
    IMessage Receive()
    Returns
    Type Description
    IMessage

    Receive(TimeSpan)

    If a message is available within the timeout duration it is returned otherwise this method returns null

    Declaration
    IMessage Receive(TimeSpan timeout)
    Parameters
    Type Name Description
    System.TimeSpan timeout
    Returns
    Type Description
    IMessage

    ReceiveNoWait()

    Receives the next message if one is immediately available for delivery on the client side otherwise this method returns null. It is never an error for this method to return null, the time of Message availability varies so your client cannot rely on this method to receive a message immediately after one has been sent.

    Declaration
    IMessage ReceiveNoWait()
    Returns
    Type Description
    IMessage

    Events

    Listener

    An asynchronous listener which can be used to consume messages asynchronously

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