Question About Distributor and Subscriptions


(Phil Sandler) #1

We currently have an endpoint (NSB 5.x) that is using the Distributor. We originally put the Distributor in place in order to distribute commands between two nodes of the same logical service.

The endpoint no longer processes commands–it only uses the bus to publish events. I believe from this perspective we don’t need the Distributor anymore.

However, I’m not clear on what would happen if we brought a new subscriber online. In our current configuration, I believe the subscription request message would be processed via the distributor, and given to one of the worker nodes, which would add the new subscriber to the subscription storage (which is shared between all worker nodes).

Would it make sense to just point the subscribers at one of the publishing endpoints in UnicastBusConfig, so that the subscription requests can still be processed?

Would there be any other implications to removing the distributor in our scenario?



(Ramon Smits) #2

You still need the distributor if a logical subscriber is scaled out.

Reason for this is that if you would not use the distributor that each instance would register itself as a unique subscriber which would result in each instance to receive a copy of the event.

If you would move away from the distributor than you could consider upgrading to NServiceBus 7 (or even 6) which adds Sender Side Distribution

NServiceBus 6+ stores logical endpoint information of a subscription and will behave similarly as with the distributor that if you have multiple instance for the same logical endpoint that only one of the instances will receive a copy of the event making sure that logical endpoint will only process that message once.

(Phil Sandler) #3

That makes sense. That’s not a concern currently, and will be something we need to take into account when we upgrade to NSB 6.x or 7.x.