What does MassTransit add to RabbitMQ?

15,517

Things that MT adds on top of just using RabbitMQ:

  • Multithreaded, concurrent consumers
  • Message serialization, including interfaces, and versioning
  • Automatic exchange bindings, publish conventions
  • Sagas, including persistent state via NHibernate
  • Performance counters for your services
  • Message headers
  • Fault handling

Those are just a few, some more significant than others. The fact that the bus hosts your consumers, handlers, sagas, and manages all of the threading is probably the biggest advantage, and the fact that you can host multiple buses in the same process.

Serialization is the next biggest benefit, since that can be painful to figure out, and getting an interface-based message contract with automatic deserialized into types (including dynamically-backed interface types) is huge. Publishing a single class that implements multiple interfaces, and seeing all interested consumers pick up their piece of the message asynchronously is just awesome in production as new interfaces can be added to producers and downlevel consumers are unaffected.

Those are a few, you can check out the documentation for more information, or give the really old .NET Rocks! podcast a listen for some related content by yours truly.

UPDATE: There is an entire series on YouTube covering MassTransit now.

Share:
15,517

Related videos on Youtube

Endy Tjahjono
Author by

Endy Tjahjono

Updated on June 06, 2022

Comments

  • Endy Tjahjono
    Endy Tjahjono almost 2 years

    What is the benefit of building on top of MassTransit compared to building directly on top of RabbitMQ?

    I believe one benefit provided by MassTransit is 'type' exchange (publish subscribe by interface / type) so the content of the message is structured, compared to plain RabbitMQ exchanges where the content of the message is unstructured text / blob.

    What other benefits provided by MassTransit?

  • David Pfeffer
    David Pfeffer over 11 years
    The abstraction is also nice. We use Azure Service Buses in the cloud and RabbitMQ when deploying on customer premises without any significant code changes.