

At the time of writing, this wasn’t documented on the MassTransit page. There were 2 changes that I needed to make to my Startup.cs.

I went with configuring it in an Autofac module. Net Core, there are a few ways of configuring MassTransit. Net core setup guide but as usual, the answer was found on StackOverflow.įor. There was only one gotcha, that probably should be included in the. Looking back at it there isn’t a lot involved to configure a basic setup of MassTransit. The API will subscribe to this Event and listen for it before returning a synchronous result that includes the time that the process took. The Service will then take the command off the bus and consume it, before publishing an Event indicating that the Ping was consumed.

We will set up a Ping Controller in the API that will dispatch a command to the service via MassTransit. The 1st will be an API, and the Second will be a Service for application logic, working with a DB or whatever you want it to do. There will be 2 services that will communicate together across the bus. I want to bring the information I needed to get it working together in one place. All the information to get MassTransit setup is out there but it is spread across the documentation, GitHub issues, StackOverflow and all the other usual places. My application already uses AutoFac as a DI container, that I will take advantage of in this post. In this post, I want to set up MassTransit with RabbitMq and.
