开发者

nServiceBus MSMQ error when subscribing to queue

开发者 https://www.devze.com 2023-01-06 19:58 出处:网络
This may be something terribly obvious, I am just getting started with nSB.I will try to be as detailed as I can be.Lets start with the code:

This may be something terribly obvious, I am just getting started with nSB. I will try to be as detailed as I can be. Lets start with the code:

Here is the endpoint configuration code: http://www.pastebin.ca/1896246

And the app.config: http://www.pastebin.ca/1896249

Finally here is the output being logged when I run NServiceBus.Host.exe http://www.pastebin.ca/1896253

Oddly enough the bus still works and can receive messages and p开发者_JS百科rocess them, as I see here: http://www.pastebin.ca/1896257

The last thing that concerns me is that I get repeated System.Messaging.MessageQueueException errors while the host process is running:

Timeout for the requested operation has expired

MessageQueueErrorCode: System.Messaging.MessageQueueErrorCode.IOTimeout

StackTrace: at System.Messaging.MessageQueue.ReceiveCurrent(TimeSpan timeout, Int32 action, CursorHandle cursor, MessagePropertyFilter filter, MessageQueueTransaction internalTransaction, MessageQueueTransactionType transactionType)


You don't need to worry about those MSMQ exceptions as they are internal to NServiceBus and are swallowed by the framework.


From the exception it looks like you are performing a receive with a timeout. If there is no message to receive then MSMQ is going to eventually generate an exception when the timeout is reached. You just need to catch the exception and move on if this is an expected scenario (i.e. no message in the queue). If there is ALWAYS a message in the queue then I would be interested in where the cursor is pointing at the time.

Cheers
John Breakwell

0

精彩评论

暂无评论...
验证码 换一张
取 消