Introduction to Concepts
Welcome to MassTransit, the most popular framework for building distributed, message-based application in .NET.
MassTransit is more than a simple wrapper around a message broker. It is a complete application framework for building distributed applications that are reliable, scalable, and available.
Before you get started, it is important to learn the mental model of MassTransit. The foundational knowledge of these concepts will help architects, team leads, and developers establish a shared understanding of how message-driven systems work within MassTransit’s architecture.
Understand the Concepts
Section titled “Understand the Concepts”Before you start writing any code (or, in this day and age, start having AI write code for you), it is crucial to understand:
- How messages are used to represent commands and events
- How consumers subscribe to messages and how they are executed
- How producers send or publish messages to consumers
- How workflows (saga state machines, routing slips, job consumers) orchestrate/choreograph complex operations
- How exchanges, topics, queues, subscriptions, and bindings shape your broker topology
- How transports differ in capabilities and when one is a better fit than another
- How durability, retries, scheduling, and fault handling influence system behavior
The goal of this section is to give you the vocabulary, mental models, and architectural patterns needed to build systems that benefit from message-driven design rather than fight against it. You will find foundational explanations of:
Next Steps
Section titled “Next Steps”Once you understand the conceptual components, you’re ready to start implementing your first application.
Follow the Guides
Section titled “Follow the Guides”The extension collection of guides will show you how to apply these concepts in real projects:
- Create message contracts
- Create consumers
- Create saga state machines
- Create routing slip activities, build and execute routing slips
- Unit test consumers, saga state machines, and routing slip activities
- Create new and use existing middleware filters
Apply the Configuration
Section titled “Apply the Configuration”The Configuration section provides detailed explanations of how to configure:
- The bus
- Transports, including RabbitMQ, Azure Service Bus, and Amazon SQS
- Consumers, saga state machines, and routing slip activities
- Schedulers, built-in or using Quartz.NET / Hangfire
- Middleware, including retry, redelivery, and the outbox
Complete the Learning Path
Section titled “Complete the Learning Path”A typical learning path looks like this:
- Concepts, Understand the architecture and vocabulary
- Guides, Build working examples and patterns
- Configuration, Apply the options needed for production
Mastering these three sections in order will ensure that your team builds message-driven systems that are:
- Easier to reason about
- More resilient under load
- Simpler to operate
- Capable of evolving over years without breaking contracts