NServiceBus
NServiceBus copied to clipboard
Routing API is hard to find
This issue was transferred fro a private repository
With v6, the message endpoint mappings in the app.config style to configure routing has been removed. This forces all users to use the code first routing API (https://docs.particular.net/nservicebus/messaging/routing). This is one of the biggest impacts when updating from v6 to v7 assuming that users didn't already switch to the code first routing when upgrading to v6 from v5.
Because the routing configuration currently depends on the transport's capabilities (to determine whether it supports native pub/sub or message driven pub/sub) it is nested in the transport configuration API (endpointConfiguration.UseTransport<MyTransport>().Routing()). From a user perspective this feels like an unnecessary nesting and is hard to find without consulting documentation. Unless using only pub/sub on transports with native pub/sub, every endpoints requires some routing configuration so the nesting hits a lot of customers.
Also, having Routing be dependent upon the .UseTransport<T>() call makes centralizing configuration difficult and awkward, either by using an INeedInitialization, or an endpoint factory, you have to come up with some hacky way of supplying the routing.
If using INeedInitialization, each endpoint would need to duplicate the UseTransport call to do its thing.
For an endpoint factory, you need to build something like EndpointFactory.Create<T>(string endpointName, Action<RoutingExtensions<T>> routing) (disclaimer: class names from memory).
None of that is super obvious.