Closed ben-jacobs closed 6 years ago
Damn, I thought that was possible 🙁 I must have accidentally removed that parameter. I'll bring in an overload that makes it possible... stay tuned
it's out in 5.1.0 in a few seconds – thanks for reporting this issue! 😄
so you should be able to do this now:
builder.RegisterRebus((configurer, context) => configurer
.Transport(t => t.UseMsmq("my-queue")
.Sagas(t => t.StoreInRavenDb(c.Resolve<IDocumentStore>())
.Timeouts(t => t.StoreInRavenDb(c.Resolve<IDocumentStore>())))))))));
PS: I put some extra )
in there – couldn't keep count in my head
With the old API, we could access IComponentContext to resolve components used in the Rebus configuration - e.g. IDocumentStore if using the RavenDB connectors.
e.g.
var busConfiguration = Rebus.Config.Configure.With(new AutofacContainerAdapter(c.Resolve<IContainer>()))
.Logging(l => l.Serilog(Log.Logger))
.Timeouts(t => t.StoreInRavenDb(c.Resolve<IDocumentStore>()))
.Sagas(s => s.StoreInRavenDb(c.Resolve<IDocumentStore>()))
.Transport(t => t.UseRabbitMq(connectionString, inputQueueName))
How can we access the ComponentContext with this new API to allow for resolving components for the transport registrations etc?
Cheers.