rebus-org / Rebus.Autofac

:bus: Autofac container adapter for Rebus
https://mookid.dk/category/rebus
Other
12 stars 11 forks source link

Added support for multiple bus handlers within a single IoC container #21

Closed kendallb closed 3 years ago

kendallb commented 3 years ago

Added support for multiple handlers in a single container so you can use the same IoC pipeline to send messages to multiple queues, and process those messages from multiple queues within the same IoC container with different threads. It works by using type based routing and excluding handlers except those that are derived from the types you want in each queue.


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.

kendallb commented 3 years ago

Note, this will need this PR to be built and deployed with the main Rebus project in order to be able to build. I am doing my own personal build for the moment to use it.

https://github.com/rebus-org/Rebus/pull/942

https://www.nuget.org/packages/AMain.Rebus/

mookid8000 commented 3 years ago

Hi @kendallb , I appreciate your work, but this is reaching a bit too far at the moment.

I'm contemplating how to add support for hosting multiple bus instances in the https://github.com/rebus-org/Rebus.ServiceProvider package, which is pretty similar to the Autofac integration.

When I narrow in on a design there, I'm ready to talk about how to do it with Autofac too, so I'm closing this PR for now. 😐

kendallb commented 3 years ago

Sounds good. The solution I built works for what I need at the moment but it’s still a work in progress. When you settle on a design for service provider I can reimplement it the same way for autofac for consistency.