Scaling out MSMQ endpoints

Component: MSMQ Transport
Standard support for version 5.x of NServiceBus has expired. For more information see our Support Policy.

In bus transports like MSMQ, there is no central place from which multiple instances of an endpoint can receive messages concurrently. Each instance has its own queue so scaling out requires distributing messages between the queues.

The distributor is located between the senders and the receiving cluster. The role of the distributor is to forward incoming messages to a number of workers in order to balance the load. The workers are, in effect, invisible to the outside world because the outgoing messages contain the distributor's (not the worker's) address in the reply-to header.

MSMQ remote receive

Version 4 of MSMQ, made available with Vista and Server 2008, can perform remote transactional receive. This means that processes on other machines can transactionally pull work from a queue on a different machine. If the machine processing the message crashes, the message rolls back to the queue and other machines could then process it.

One problem with 'remote transactional receive' is that it gets proportionally slower as more worker nodes are added. This is due to the overhead of managing more transactions, as well as the longer period of time that these transactions are open. In short, the scale-out benefits of MSMQ version 4 by itself are quite limited.

Related Articles

Last modified