NServiceBus vs MassTransit
I'm struggling with a pros and cons list regarding NServiceBus and MassTransit.
Now I know there is already a thread in here, but it doesn't really answer my questions.
Here is what I've read so far:
- NServiceBus, yes it's licensed and it doesn't come for free.
- MassTransit, yes it's open source, but the documentation seems to lack somewhat.
NServiceBus is older, and has more references. It's hard to find stuff about MassTransit, but I'm open-minded. However I have to deliver a solid solution, and so I have to ask.
So please, someone with experience with both frameworks. Why should I choose NServiceBus? OR Why should I choose MassTransit?
Is it performance, security, scale or?
If I had to summarize, here's what I'd say:
If you need commercial support, go for NServiceBus. If you're comfortable with using forums as a means of support, MassTransit is a great option. The developers have been very responsive to our issues so far. If you choose MassTransit, now you will choose between MSMQ and RabbitMQ. If you need DTC go with MSMQ. If you want more features and better administration, go with RabbitMQ.
On our project, we switched from NServiceBus to MassTransit for two reasons:
- MassTransit is free
- We love RabbitMQ
I've used both frameworks. I've used MassTransit longer than NServiceBus. Here are the highlights as I see them.
Cost:
- MassTransit is Apache 2.0 licensed and free for commercial production use, whereas NServiceBus is not.
Support:
- As Udi mentioned, there is an option for commercial NServiceBus support, I haven't seen that for MassTransit.
Transport:
- MassTransit supports MSMQ and RabbitMQ
-
NServiceBus supports only MSMQRabbitMQ is supported in NServiceBus 4+
RabbitMQ vs MSMQ:
- MSMQ support DTC (distributed transaction coordinator) for transactions involving multiple processes on potentially multiple machines (e.g. SQL server, Windows Service)
- RabbitMQ has an excellent Administration interface
- MSMQ has been around longer and is a Microsoft product
- RabbitMQ is newer, open source, free, and sponsored by VMWare
- MSMQ is installed on most Windows machines by default
Udi Dahan and the MassTransit guys (Chris Patterson, Dru Sellers, and Travis Smith) are all brilliant people.
As the original author of NServiceBus, I'm probably a bit biased towards my own technology, but I'll try to keep this as balanced as I can.
Transport support
Both NServiceBus and MassTransit support RabbitMQ and Azure Service Bus, but NServiceBus also supports:
- Amazon SQS
- Azure Storage Queues
- SQL Server (using plain tables)
- MSMQ
On the topic of RabbitMQ
The argument could be made that NServiceBus has stronger support for RabbitMQ - for example, in its delayed delivery functionality while Mass Transit states that their "plugin is still considered as experimental. It is supported by MassTransit, but we cannot guarantee anything more than the plugin guarantees itself."
We also work very closely with the RabbitMQ team, contributing to the .net SDK for the benefit of the whole ecosystem.
When it comes to Azure Service Bus
The level of collaboration we have with the Azure Service Bus team is even higher, with over 70 PRs to their .net core SDK.
When you use NServiceBus, you benefit from the full depth of that knowledge.
Tooling
This is the biggest difference.
Once you've built a substantial system, having visibility into how all the different moving parts talk to each other becomes really important. MassTransit doesn't have much in this area beyond a small integration through a Diagnostic Source to 3rd party tools like Application Insights or Open Trace.
The Service Platform around NServiceBus goes quite a bit farther, giving you the ability to see sequence diagrams across all endpoints with ServiceInsight:
You can also get the logical view of all of your endpoints and messages:
In essence, you get living documentation of your system's architecture.
Management & Monitoring
This is another area where MassTransit doesn't have very much. When a 3rd party system you're integrating with becomes unavailable and a bunch of messages in your system end up in the error queue, the only solution MassTransit has for you to manually move those messages back later using the RabbitMQ Shovel plugin.
The Service Platform around NServiceBus includes monitoring of that error queue, graphical tooling to see what the causes were of those errors, as well as the ability to replay groups of those failed messages and see that they were actually processed successfully all in a simple web app called ServicePulse.
There is also visualization of health checks which are run periodically that can provide early warnings of problems before messages start failing.
And finally, there's the performance monitoring available in the platform:
You really get the full package when it comes to production support.
Long-term support & Backwards-compatibility
While the Mass Transit folks have always been extremely good at helping anyone who has questions about it on Gitter or their Google Group, I don't think they provide bug fixes on older versions. When your production systems have been around for a couple of years, and you can't just upgrade everything all the time, that starts to be important.
With NServiceBus support includes:
- 2+ years for each major version
- An additional 2 years of extended support
- Guaranteed response times on critical issues
- 24x7 availability
Consulting & Training
From an offline perspective, there are public courses available around the world on NServiceBus as well as many consultants who can be brought on-site to kickstart a project or to assist in case of problems. I've heard from several companies that decided to switch from MassTransit to NServiceBus because they couldn't get someone on-site when they needed it.
Licensing
What some people still don't know about NServiceBus is that it is FREE for personal use and startups.
When it comes to commercial use, the licensing models around NServiceBus are very flexible, as the broad spectrum of customers indicates, and can be well justified to management. Of course, with MassTransit, the licensing is free.
Hope that helps in some way.
I know it's late to chime in on this question, but for bingleability's sake, I have to mention Rebus (which I happen to be the primary author of).
Rebus is about 8 years old now, and it has been used to move money around and control power plants from the get-go.
It supports most basic queueing systems, like MSMQ, RabbitMQ, Azure Service Bus, Azure Storage Queues, Amazon SQS, etc., but it also supports more funny stuff like using MSSQL, PostgreSQL, and Oracle as transports.
The documentation wiki is fairly comprehensive, although many people seem to get by, because Rebus' APIs are so easily discoverable.
Rebus has always been (and will always be) completely free. It's MIT-licensed, so you can basically do with it what you feel like.
If you end up as a serious Rebus user, and you need a formal support agreement and extra tooling, you can subscribe to Rebus Pro, which is offered by Rebus FM (the company behind Rebus).
The "extra tooling" mentioned above currently comes in the form of Fleet Manager, which can help with things. For example, Fleet Manager completely replaces error queues, so failed messages get stored there instead. This means that failed messages can be viewed, managed, and retried anytime with a few clicks in Fleet Manager.
Just to give a more up to date answer, I've developed professionally with both ecosystems and they both now support a broad range of MQ technologies, and .NET Core.
I used NServicebus a few years back on a new cloud product, we needed .NET Core which Mass Transit didn't support at the time. I have to say - it's a lovely thing to use as developer, there's a lot of nice one liners, great tooling/monitoring and the documentation is really good.
Various levels of support and license are available, and on one occasion we needed some help, it was good quality.
I've been using Mass Transit for a few months at a new company, and they much prefer having a free, open-source library. The journey has been a bit rockier - the documentation for MT is lacking in places, and a lot of examples/issues are out of date. There's not quite the range of advanced features either, but you may well not need them for their use case.
It works fine though, and the MT developers seem to put a LOT of effort into supporting their OSS - way beyond what you could reasonably expect.
So personally, my TLDR would be - get NServicebus if your company can be convinced to pay for it, but MT is a serviceable alternative and the best you can get for gratis.
You could always use Shuttle (FOSS): https://github.com/Shuttle/shuttle-esb :)
Documentation (always improving): http://shuttle.github.io/shuttle-esb/
The Shuttle project has been going almost 2 years and is used production systems. It'll be a matter of choosing what resonates with you.
NServiceBus has a good track record. I have used it previously on a production system (1.9) but not since it has gone commercial (the point at which I started with Shuttle).
I haven't tried MassTransit.
I guess all your options will have the basics (command / event / pub-sub). However, NServiceBus does have sagas and the data bus stuff although I reckon it is easy enough to handle data outside of the service bus itself such as in your endpoint message handlers. I don't know whether MassTransit has sagas/data bus but Shuttle certainly doesn't.
Another consideration is probably how you intend using the service bus. If it is to be part of a product then for a commercial option such as NServiceBus you would need to consider the cost implications for users of your product and although it is still something that needs to be considered for in-house development it can certainly be justified.