Reads messages from MessageQueues, dispatches them, and checks for dispatch timeouts More...
Public Member Functions | |
void | BeginStop () |
The begin stop. More... | |
bool | EndStop (int waitSeconds) |
waits until reading stops or timeout expired More... | |
void | Start () |
Creates a listening thread and starts it. While running, the thread will listen to the specified message queue and dispatch incoming messages by calling the abstract method DispatchMessage. If UsePeeking is set to true, no messages will be lost if an error occurs during the procession of the message. More... | |
void | Stop () |
Stops the reader thread, throws TimeoutException if not stopped within 1 minute. More... | |
bool | Stop (int waitSeconds) |
Stops the reader thread. More... | |
void | Dispose () |
The dispose. More... | |
Protected Member Functions | |
MessageQueueReader (string msmq) | |
Initializes a new instance of the MessageQueueReader class. More... | |
abstract void | DispatchMessage (Message message) |
Implementors should provide functionality to process the received message. More... | |
virtual void | Dispose (bool disposing) |
The dispose. More... | |
virtual IMessageFormatter | GetFormatter () |
Returns a formatter for the messages of the queue. More... | |
virtual void | OnException (Exception ex) |
The on exception. More... | |
virtual void | OnStart (MessageQueue messageQueue) |
The on start. More... | |
virtual void | OnStop (MessageQueue messageQueue) |
The on stop. More... | |
Properties | |
string | Path [get] |
returns the message queue format name More... | |
bool | Stopped [get] |
Gets a value indicating whether Stopped. More... | |
virtual TimeSpan | DispatchTimeout [get] |
Timeout for message processing, after timeout occurs a TimeoutException More... | |
virtual bool | DoCreateMessageQueueIfNotExists [get] |
Gets a value indicating whether DoCreateMessageQueueIfNotExists. More... | |
abstract ILogger | Log [get] |
Gets Log. More... | |
virtual int | MaxDispatchTimeouts [get] |
reading stops if more timeouts occur at a time More... | |
virtual int | MaxThreads [get] |
returns 1 if not overidden More... | |
virtual bool | PurgeOnStart [get] |
set true to purge messages on start More... | |
virtual bool | UsePeeking [get] |
Gets a value indicating whether to use MessageQueue.Peek() instead of MessageQueue.Receive() to receive messages. If UsePeeking is set to true, messages will not be lost if an error occurs during procession of the message. More... | |
virtual TimeSpan | WaitTime [get] |
Gets the time the listening thread should wait for an incoming message. Stopping is delayed by this timespan. More... | |
Reads messages from MessageQueues, dispatches them, and checks for dispatch timeouts
|
inlineprotected |
Initializes a new instance of the MessageQueueReader class.
msmq | The path of the MessageQueue to which the reader thread should listen. |
|
inline |
The begin stop.
|
protectedpure virtual |
Implementors should provide functionality to process the received message.
message | The message received by the message queue listen thread. |
|
inline |
The dispose.
|
inlineprotectedvirtual |
The dispose.
disposing | The disposing. |
|
inline |
waits until reading stops or timeout expired
waitSeconds | timeout |
|
inlineprotectedvirtual |
Returns a formatter for the messages of the queue.
|
inlineprotectedvirtual |
The on exception.
ex | The ex. |
|
inlineprotectedvirtual |
The on start.
messageQueue | The message queue. |
|
inlineprotectedvirtual |
The on stop.
messageQueue | The message queue. |
|
inline |
Creates a listening thread and starts it. While running, the thread will listen to the specified message queue and dispatch incoming messages by calling the abstract method DispatchMessage. If UsePeeking is set to true, no messages will be lost if an error occurs during the procession of the message.
|
inline |
Stops the reader thread, throws TimeoutException if not stopped within 1 minute.
|
inline |
Stops the reader thread.
waitSeconds | The wait seconds. |
|
getprotected |
Timeout for message processing, after timeout occurs a TimeoutException
2 minutes if property is not overridden.
|
getprotected |
Gets a value indicating whether DoCreateMessageQueueIfNotExists.
|
getprotected |
Gets Log.
|
getprotected |
reading stops if more timeouts occur at a time
default value is 9
|
getprotected |
returns 1 if not overidden
|
get |
returns the message queue format name
|
getprotected |
set true to purge messages on start
false
if not overridden
|
get |
Gets a value indicating whether Stopped.
|
getprotected |
Gets a value indicating whether to use MessageQueue.Peek() instead of MessageQueue.Receive() to receive messages. If UsePeeking is set to true, messages will not be lost if an error occurs during procession of the message.
true
if MessageQueue.Peek should be used; false
if MessageQueue.Receive should be used. Returns false if method is not overridden.
|
getprotected |
Gets the time the listening thread should wait for an incoming message. Stopping is delayed by this timespan.
10 seconds if property is not overridden.