
Masstransit autofac fault registration#
To add a saga registration and configure the consumer endpoint in the same expression, a definition can automatically be created.

The host options can be configured via MassTransitHostOptions using the Options pattern as shown below.Ĭlass SubmitOrderConsumer : IConsumer ) Copy to clipboard MassTransit adds a hosted service so that the generic host can start and stop the bus (or buses, if multiple bus instances are configured). To configure multiple bus instances in the same service collection, refer to the MultiBus section. Health checks for the bus (or buses) and receive endpoints.Each example focuses on simplicity, and therefore may omit certain extra features to avoid.
MassTransit will publish a message that implements Fault
I have used the code example on the relevant MassTransit documentation page as a starting point, but the code code presented below is slightly different.

I’m most familiar with StructureMap so I’ll use that in this example. Any methods to configure the bus instance (using x) should be called outside of this callback.Īdding MassTransit, as shown above, will configure the service collection with required components, including: Register an IConsumer with dependency in Masstransit using Autofac-C. MassTransit supports a number of IoC containers including Ninject, Unity, Autofac, Castle Windsor and StructureMap. The callback passed to the UsingRabbitMq method is invoked after the service collection has been built.
