rebus-org / Rebus.ServiceProvider

:bus: Microsoft Extensions Dependency Injection container adapter for Rebus
https://mookid.dk/category/rebus
Other
65 stars 32 forks source link

Feature request: Possibility to add multiple rebus services from startup ConfigureServices #39

Closed jfalameda closed 3 years ago

jfalameda commented 3 years ago

Hi,

I noticed there is no straight forward possibility to configure multiple pipelines on Rebus for .NET. I saw the workaround you commented on another thread regarding using BackgroundService. This is problematic for most cases as the vast majority of services and configurations are declared one level up at ConfigureServices at Startup.cs.

Do you have any other workarounds in mind to mitigate this issue?

Kind Regards, José.

mookid8000 commented 3 years ago

Do you have any other workarounds in mind to mitigate this issue?

Not really, no.... but I was contemplating using Nub to support registering multiple (keyed) IBus registrations somehow.

It should be done in a way where the IBus injected into Rebus handlers would always be the bus instance belonging to the receiver, and then one of the bus instances should somehow be appointed "the default bus", which would mean that it would be the one injected into everything else (MVC controllers, etc).

Did you have any thoughts similar to this? Or do you have other ideas?

jfalameda commented 3 years ago

Hi,

Yes, it worked great, thanks.