Mike
Mike

Reputation: 882

How MSMQ handles connection with remote machine

I have Client machine and Server machine. Both machines are in the same network. If an application on Client machine tries to send something to a queue on the Server machine, is MSMQ service capable of handling a situation where Server machine suddenly goes offline? Assuming some enqueued messages were already delivered, will it try to retransmit the queue each i.e. 5 seconds? I can't find relevant information about that.

Also, my idea is to use MSMQ as a mediator between an application on client and an application on server where client<->server connection is very unreliable. I was thinking that instead of writing my own implementation of recovery from link interruption, I will just let MSMQ do it by sending messages from Client machine to Server machine and let server application read from it's local (Server) queue. Is it proper way to do it? Will it work for machines that are not within AD? Perhaps if they are in AD, a public queue would be the way to go if it's supposed to be duplicated across the network?

Upvotes: 0

Views: 294

Answers (1)

John Breakwell
John Breakwell

Reputation: 4687

MSMQ relies on:

  1. The TCP/IP retry mechanism
  2. The MSMQ retry mechanism

to ensure message delivery. Note that the delivery mechanism differs for express (fire-and-forget) and transactional (guaranteed) messages. MSMQ sends acknowledgement messages to system queues to ensure delivery. There is also a duplicate detection mechanism.

"Is it proper way to do it?"
Yes, you are discussing the classic MSMQ model.

"Will it work for machines that are not within AD?"
AD doesn't affect how MSMQ sends messages.

"Perhaps if they are in AD, a public queue would be the way to go if it's supposed to be duplicated across the network?"
All AD does is allow you to store information about a queue. The queue itself exists in only one place. AD just replicates how to find that one queue. In most cases, AD is an unnecessary overhead for MSMQ. By all means use MSMQ on domain-member machines but don't feel you have to use public queues just because they are there.

Upvotes: 1

Related Questions