I don’t have time to write everything up, so I’m asking you to trust me when I say auto-subscribe is not an option for our projects.
I am working on upgrading our code from NSB v5 and v6 to v7 to test whether we will be able to migrate completely to .NetStandard 2.0. Here are the relevant PackageReference entries from our .csproj:
<PackageReference Include="Ninject" Version="3.3.4" /> <PackageReference Include="NServiceBus.Newtonsoft.Json" Version="2.0.0-beta0002" /> <PackageReference Include="NServiceBus.Ninject" Version="7.0.0-beta0003" /> <PackageReference Include="NServiceBus.Persistence.Sql" Version="4.0.0-beta0002" /> <PackageReference Include="NServiceBus.SqlServer" Version="4.0.0-beta0004" />
Our apps consist of multiple Windows services, all of which subscribe to some events and publish other events. In both our v5 and v6 based apps, we write our “MessageEndpointMappings” config entries such that the Endpoint attribute for each event is the current service’s queue, since that is the only queue that is guaranteed to be configured when we call subscribe for that event. This worked great because the subscriber code didn’t have to be updated whenever another service publishes an existing event. It worked because all the subscription information was written to a single Subscription table shared by all the services associated with that bus.
From what I’ve seen so far in v7, each service gets it’s own subscription table, so the subscriber now must know all the publishers of the events it cares about. Additionally, a subscription command must be processed by each logical publisher before that publisher can notify the subscriber. This means an unknown number of other messages will need to be processed by the publishers before they even see the subscription command, leading to subscribers missing any events that were published after the subscriber sent the subscription command but before that event’s publisher processed the subscription command.
Can someone explain why the Subscription table was split? I’m assuming it was done with good intentions, but ,on my own, I can’t think of any benefit to the new pattern.