Data distribution

Component: NServiceBus
NuGet Package NServiceBus (7-pre)
This page targets a pre-release version and is subject to change prior to the final release.
Asynchronous messaging is not an optimal solution for data distribution scenarios. It is usually better to use a dedicated data distribution technology for that purpose, such as a distributed cache or distributed configuration service.

NServiceBus Publish/Subscribe mechanism always delivers events to a single instance of each logical subscriber. Sometimes, however, there is a reason for delivering each event to all instances of the subscriber in order to distribute data. While it is usually better to use a dedicated data distribution technology for that purpose (e.g. a distributed caching solution), NServiceBus can also be used in data-distribution mode.

Because NServiceBus groups subscribers based on the endpoint name, in data distribution scenario each endpoint instance has to be given different endpoint name. Usually that name consists of the logical name e.g. WebFrontend and a suffix which can be either read from a configuration file or obtained from the environment (e.g. Azure role instance ID). To read more about this pattern see the data distribution sample.


Last modified