I'm trying to setup a single service that is broken into several logical services. Because they are logical services, they each get there own queue. Each logical service is a module in autofac.
The setup looks vaguely like:
sbc.ReceiveEndpoint(host, "service1", ep => {
ep.LoadFrom(c.Resolve<ILifetimeScope>())
});
sbc.ReceiveEndpoint(host, "service2", ep => {
ep.LoadFrom(c.Resolve<ILifetimeScope>())
});
But I think this would cause every consumer to be subscribed on every queue.
Is there a built in way I can get autofac to only register consumers from a specific module or would I have to write my own adapter?
You would need to write your own adapter. It's not a lot of work. Make sure you resolve the consumers from the container as the concrete class, and not as implementation of Consumes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With