Question

We are considering using MSMQ as a message processing service in our application. What we want is - MSMQ in a farm of servers sitting behind Network Load Balancer (NLB) that distributes load among the nodes. I have the following questions for which I couldn't find any pointers online.

1) Do I need to have MSMQ installed in all nodes?
2) If so, when the sender application sends a message to MSMQ should it send to all nodes?
3) If answer to my 2nd question is yes, then when a message is received by the client application, how should the other nodes be notified about the message being received by the client and subsequently remove from them?

Would appreciate any help/pointers.

Was it helpful?

Solution

Here are some blog posts that may help:

Q1) Do I need to have MSMQ installed in all nodes?
A1) You need MSMQ installed on every server that a message will be delivered too.

Q2) If so, when the sender application sends a message to MSMQ should it send to all nodes?
A2) That's one way to load-balance where you send X messages to X nodes but only read from 1 node, discarding the other copies.
Another method is to send to a network load balancer that sends one message to one randomly-selected node, although MSMQ is very sticky so very difficult/impossible to load balance high volumes in that way.

Q3) If answer to my 2nd question is yes, then when a message is received by the client application, how should the other nodes be notified about the message being received by the client and subsequently remove from them?
A3) That is the down-side to the type of load-balancing you're suggested. MSMQ won't remove a message unless either your application removes it or the TimeToBeReceived timer expires. basically, you will need to have co-ordinated client applications if you need to avoid duplicate message processing.

Cheers
John Breakwell

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top