rebus-org / Rebus.ServiceProvider

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

Register DependencyInjectionHandlerActivator as IHandlerActivator #45

Closed skwasjer closed 3 years ago

skwasjer commented 3 years ago

Register DependencyInjectionHandlerActivator as IHandlerActivator allowing it to be patched/mocked.

Context We have a use case where we want to change the way handlers are registered and resolved somewhat, while keeping all other service container registrations as-is. By registering as IHandlerActivator we can replace/decorate the implementation of this service type after registering Rebus (with AddRebus())


Rebus is MIT-licensed. The code submitted in this pull request needs to carry the MIT license too. By leaving this text in, I hereby acknowledge that the code submitted in the pull request has the MIT license and can be merged with the Rebus codebase.

CLAassistant commented 3 years ago

CLA assistant check
All committers have signed the CLA.

skwasjer commented 3 years ago

Oops, literally same as #41 :D

Although I would like to use it to resolve handlers selectively and not to inject headers as proposed in that PR example.

mookid8000 commented 3 years ago

41 was released as Rebus.ServiceProvider 6.0.0-a3 just now 🙂 thanks for reminding me