Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does MassTransit add to RabbitMQ?

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?

like image 530
Endy Tjahjono Avatar asked Sep 06 '12 09:09

Endy Tjahjono


People also ask

What is MassTransit in RabbitMQ?

What is MassTransit? MassTransit is a free, open-source, distributed application framework for . NET applications. It abstracts away the underlying logic required to work with message brokers, such as RabbitMQ, making it easier to create message-based, loosely coupled applications.

What is difference between RabbitMQ and MassTransit?

MassTransit is free software/open-source . NET-based Enterprise Service Bus software that helps Microsoft developers route messages over MSMQ, RabbitMQ, TIBCO and ActiveMQ service busses, with native support for MSMQ and RabbitMQ; RabbitMQ: A messaging broker - an intermediary for messaging.

How does RabbitMQ deliver messages?

Applications can subscribe to have RabbitMQ push enqueued messages (deliveries) to them. This is done by registering a consumer (subscription) on a queue. After a subscription is in place, RabbitMQ will begin delivering messages. For each delivery a user-provided handler will be invoked.


1 Answers

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.

like image 159
Chris Patterson Avatar answered Sep 30 '22 22:09

Chris Patterson