Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSMQ transport can't recover from connectivity issues #329

Open
SzymonPobiega opened this issue Nov 3, 2021 · 0 comments
Open

MSMQ transport can't recover from connectivity issues #329

SzymonPobiega opened this issue Nov 3, 2021 · 0 comments

Comments

@SzymonPobiega
Copy link
Member

SzymonPobiega commented Nov 3, 2021

When the MSMQ service is down, the MSMQ transport signals the critical error (as it should) and logs problems (as it should) but when the connectivity is restored, it starts throwing different exceptions:

System.Messaging.MessageQueueException (0x80004005): An invalid handle was passed to the function.
   at System.Messaging.MessageEnumerator.MoveNext(TimeSpan timeout)
   at NServiceBus.Transport.Msmq.MessagePump.<InnerProcessMessages>d__6.MoveNext()

and the endpoint is unable to resume processing of messages until it is restarted. Combined with the default critical error handling of noop this makes it hard to notice endpoints that are not processing any messages. The expected behavior is for MSMQ to resume processing after the connection is restored.

Symptoms

The endpoint stops processing of the messages until restarted

Who's affeected

All users of the MSMQ transport are affected

Workaround

Define a dependency between the Windows Service hosting the NServiceBus endpoint and the MSMQ service via the Services UI (services.msc). This dependency will make sure to stop and restart the NServiceBus endpoint after MSMQ is back online.

Related issues

Originally raised in the NServiceBus.Router repository

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants