How to detect a connection break using MessageQueue

My C # application uses a class MessageQueuein .NET to exchange messages with another remote application, and MessageQueue should always be “connected” (present heartbeat) with the remote message Queue under any circumstances. If it is not “connected”, then it signals that something is wrong, and my application will need to perform some actions, such as updating the event log.

Is there a method in the class MessageQueuethat can be used to detect such gaps in a connection?

+5
source share
1 answer

The message queue is very useful for surviving disconnects. And supports routing across multiple machines. Thus, he has no way to check for a live connection. You should probably not consider MSMQ, if that is the requirement, TCP will be the best mouse trap.

You may consider requesting confirmation of your message and a timeout on this. It is passive. A heartbeat is possible, but be sure to use a separate, non-transactional queue.

+3
source

All Articles