Gets or sets the listener time limit to continuously receive messages. The value is specified in milliseconds. The default value is TimeSpan.Zero, indicating to only perform one Receive operation per Peek trigger.

Initializes this container. Calls the abstract method DoInitialize to initialize the listening infrastructure (i.e. subclasses will typically resolve a MessageQueue instance from a MessageQueueObjectName) and then calls the abstract method DoStart if the property AutoStartup is set to true,

Protected Instance Fields

Most operations within the MessageListener container hierarchy use methods on the MessageQueue instance which are thread safe (BeginPeek, BeginReceive, EndPeek, EndReceive, GetAllMessages, Peek, and Receive). When using another method on the shared MessageQueue instance, wrap calls with a lock on this object.

Protected Instance Methods

Closes the queue handle. Cancel pending receive operation by closing the queue handle To properly dispose of the queue handle, ensure that EnableConnectionCache=false on the MessageQueue that this listener is configured to use.

Template method that execute listener with the provided message if Running is true. Subclasses will call this method at the appropriate point in their processing lifecycle, for example committing or rolling back a transaction if needed.

Template method that gets called right when a new message has been received, before attempting to process it. Allows subclasses to react to the event of an actual incoming message, for example adapting their consumer count.

The callback when the peek has completed. Schedule up to the maximum number of concurrent listeners to receive messages off the queue. Delegates to the abstract method DoReceiveAndExecute so that subclasses may customize the receiving process, for example to surround the receive operation with transactional semantics.