

#Masstransit example code
A command can be sent from multiple points in the code but is consumed by a single endpoint, consumer or command handler. They are named in the imperative such asĬommands can be validated and rejected by a command handler if they are invalid. Commands are instructions to perform some action. We should, perhaps, take a moment here to talk about the two types of messages we use in a message driven system. MassTransit layer an actual messaging layer on top of either RabbitMQ or Azure Service Bus which means that is provides for serialization and routing. Comparing the two is beyond the scope of this article but there are some good articles on that already.

For large installations I’d recommend building more tightly on top of cloud based transports, but that’s a topic for another blog post. In my mind the cost of NServiceBus is well worth it for small and medium installations. There is, of course, a cost to running NServiceBus as it is a commercial product. NServiceBus is perhaps the most well know option. NET space which can be layered on top of raw queues. There are a couple of good options in the. Wiring would be very painful on a large scale. Nobody wants to do that for any sort of sizable application. We had to do our own wiring and even our own serialization. We did it directly with RabbitMQ which was a bit of a pain.

In the last post, we created an application which can send tasks to a background processor.
