-
Notifications
You must be signed in to change notification settings - Fork 0
Rebus.Configuration
To configure rebus you normally have to use the Configure methods provided by Rebus. For example:
Configure.With(someContainerAdapter)
.Logging(l => l.Serilog())
.Transport(t => t.UseMsmq("myInputQueue"))
.Routing(r => r.TypeBased().MapAssemblyOf<SomeMessageType>("anotherInputQueue"))
.Start();
With Rebus.Configuration you can now configure rebus like this:
Configure.With(someContainerAdapter)
.Logging(l => l.Serilog())
.Transport(serviceProvider.GetRequiredService<IRebusTransportConfigurer>())
.Routing(r => r.TypeBased().MapAssemblyOf<SomeMessageType>("anotherInputQueue"))
.Start();
So transport configuration is now injected via dependency injection.
Rebus.Configuration.Selectors makes it simple to configure rebus via application configuration. To use selectors you register your selectors as implementation for transport configurer or another configurer:
services.AddSingleton<IRebusTransportConfigurer, DefaultTransportSelector>()
The transport selector will choose the rebus transport from application configuration entry bus:type
.
Default selector supports build in transports only - allowed values for type are 'inmemory' or 'filesystem'.
Selectors are grouped in 3 configuration sectors:
-
bus
transport selectors -
store
subscription, saga and timeout storage selectors -
databus
databus selectors
Please note:
Some transports register their own implementation for subscription storage or timeouts. In that case you could create your own version of a selector by inherits from a existing selector and overwriting the configuration name.