Worker node handles message from two distributor

346 views Asked by At

I have same question asked in nServicebus group. I did not get firm answer of this feature is supported. I like to post it here to see SO community thoughts.

http://tech.groups.yahoo.com/group/nservicebus/message/16487

I already have windows processor worker nodes that handles the messages from a Distributor. Now I like to extend this worker node to handle messages from another distributor with different queue names. When I looked at the unicast bus configuration, I found that only one distributor Control and data address can be set. Is there a way to set up multiple distributor in NServiceBus Configuration? If you also explain the pros and cons of using handling multiple distributor that would help.

1

There are 1 answers

0
David Boike On BEST ANSWER

It sounds like you may be using NServiceBus 2.x, because in NServiceBus 3.0, the Distributor story is very much changed.

Under NServiceBus 2.x, you usually set up multiple endpoints all talking to the same distributor. These endpoints become worker nodes and the distributor divides up the work between them based on each worker node reporting when it has a free thread.

So, if you had the load of messages coming into Queue X handled by X.Worker@Server1 and X.Worker@Server2, it doesn't make sense to me why you would want one of the X.Worker instances to handle messages coming into queue Y?

Instead, you should (normally) set up one Distributor per logical service. This is akin to a Network Load Balancer for HTTP traffic. Then the endpoints behind it act as the worker nodes. You can set up a second distributor, with its own worker nodes, for another logical service.

Now, with all that said, in NServiceBus 3.x, the distributor is integrated with the endpoint. So you start off with one endpoint configured as a Master Node. Basically it functions as a distributor AND a worker. Then to scale out, you simply stand up more nodes in Worker role only, pointing at the Master Node to get their work.

In that scenario, there is (generally) no freestanding Distributor. This is why I'm guessing you're referring to V2.