Michael L Perry

MassTransit: Ready to Form

Defeating the menace of distributed systems complexity is no simple task. It requires simultaneously solving the problems of consistency & reliability…

Defeating the menace of distributed systems complexity is no simple task. It requires simultaneously solving the problems of consistency & reliability, and fault tolerance. Each of these problems is difficult on their own. Taking them on all at once without a battle plan is a truly monumental task.

MassTransit has a solution. It clearly defines a series of abstractions over distributed systems problems


Defeating the menace of distributed systems complexity is no simple task. It requires simultaneously solving the problems of consistency & reliability, and fault tolerance. Each of these problems is difficult on their own. Taking them on all at once without a battle plan is a truly monumental task.


Fortunately, MassTransit has a solution. It defines a series of abstractions over distributed systems problems, giving each responsibility to a distinct component. It then offers out-of-the-box implementations for many common scenarios. And it provides a framework for assembling those components into a powerful united force.


Form Feet and Legs: TransportYour distributed system is going to need to navigate whatever terrain it finds itself in. Choose the right transport for the environment. You will need to use an in-memory implementation for unit testing. For on-premises deployment, RabbitMQ is the right tool. And when you take it to the cloud, the Amazon SQS, ActiveMQ, or Azure Service Bus transports have you covered.


Form Arms and Torso: PipelinesA solid core pulls the pieces together. In MassTransit, that's the receive endpoint. It forms the central hub to which you attach consumers and middleware. Decompose your problem so that each subset of messages has its own receive endpoint.


Configure consumers to handle messages. And inject retry, circuit breaker, and rate limiter middleware to improve fault tolerance. And I'll Form the Head: OrchestrationA distributed system would be pure chaos without the ability to keep all components consistent. That executive function belongs to the orchestrator.


Compose a state machine using Automatonymous to track progress toward a business objective. Build a routing slip using Courier to ensure that all steps happen atomically. Or code a consumer saga to apply your own orchestration pattern.


There are a lot of parts to a MassTransit solution. Each one exists to solve a specific problem. You cannot truly defeat the complexity of distributed systems design until you bring all of those pieces together into one united battle force.

Michael Perry

You may also like