SzymonPobiega / NServiceBus.Router

Cross-transport, cross-site and possibly cross-cloud router component for NServiceBus
MIT License
5 stars 10 forks source link

NServiceBus Router does not appear to survive MSMQ restarts #45

Open AJDray opened 2 years ago

AJDray commented 2 years ago

I have an NSB router responsible for Routing MSMQ messages to our Azure ServiceBus instance.

I have observed when I stop MSMQ and subsequently start it again the NServiceBus Router is unable to re-connect to the MSMQ instance.

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()

Previous versions of the Router appeared to shut down the router. Whilst the latest version 3.9.2 appears to just continually poll MSMQ.

Is there a way this could be reported as a critical error and then the service could be restarted?

SzymonPobiega commented 2 years ago

@AJDray I think this is actually a bug in the MSMQ transport itself. I'll verify that and keep you posted.

SzymonPobiega commented 2 years ago

I created an issue to track this https://github.com/Particular/NServiceBus.Transport.Msmq/issues/329