views:

54

answers:

1

My application written in C# makes use of the MessageQueue class in .NET for communicating messages with another remote application and the MessageQueue should always be "connected" (heartbeat present) with the remote messageQueue under all 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 an event log.

Is there a method in the MessageQueue class that can be used to detecting such breaks in connection?

+2  A: 

Message queuing is very much designed to survive disconnects. And supports routing through several machines. As such, it doesn't have a way to check if a live connection is present. You probably shouldn't consider MSMQ if that's a requirement, TCP would be a better mouse trap.

You could consider asking for acknowledgment of your message and time-out on that. That's passive though. A heart beat is possible, but be sure to use a separate, non transactional queue.

Hans Passant