Skip to content

MassTransit Module

MassTransit is a framework for building distributed systems. It is what we use to implement Async Communication.

The Event Broker we are currently using is RabbitMQ, but instead of using RabbitMQ libraries for .NET, MassTransit sits on top of that and abstracts us from the actual broker we are using, the same way an ORM abstracts you from the database engine.

The MassTransitModule integrates MassTransit into the Suite Framework. It supports configuration, through the MassTransitModuleOptions which can be used to declare the broker's host, user/password, etc.

The module will auto discover Saga State Machines and Consumers. Specifically, SagaStateMachine<> and IConsumer. You can just declare a new Saga class and it will be auto discovered.

MassTransitModuleOptions includes a callback for accessing MassTransit's configuration object, this can be used to further customize the bus.

MassTransit documentation is really good and we are not doing many custom stuff with it as of yet, so we recommend you read these before proceeding:

  1. RabbitMQ Transport
  2. Messages
  3. Consumers
  4. Producers
  5. Exceptions
  6. Request/Response
  7. Saga State Machine
  8. In-memory outbox