It's using named instances...
builder.Register(c => new FooImpl())
.As<IFoo>()
.Named("Foo1");
Then
container.ResolveNamed<IFoo>("Foo1");
If my Autofac syntax is correct off the top of my head. This should at least get you down the right path. Just request an instance of each IServiceBus
, so that they get resolved and created from your container.
Oh, and you can't use LoadFrom
to register the consumers. You'll have to resolve and register each one by hand. Since calling LoadFrom
will register all the consumers in your container.
You could create two subcontainers, one for each IServiceBus
but now we're well outside of the realm of what I know how to do off the top of my head with Autofac. You can do it with almost ever other container, so I assume you can with Autofac though.