.net NServiceBus 与大众运输
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13647423/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
NServiceBus vs MassTransit
提问by Hyman Andersen
I'm struggling with a pros and cons list regarding NServiceBus and MassTransit.
我正在为 NServiceBus 和 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,是的,它已获得许可,而且不是免费的。
- MassTransit,是的,它是开源的,但文档似乎有些欠缺。
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.
NServiceBus 较旧,有更多参考资料。很难找到有关 MassTransit 的内容,但我思想开放。但是我必须提供一个可靠的解决方案,所以我不得不问。
So please, someone with experience with both frameworks. Why should I choose NServiceBus? OR Why should I choose MassTransit?
所以请对这两个框架都有经验的人。我为什么要选择 NServiceBus?或 为什么我应该选择大众运输?
Is it performance, security, scale or?
是性能、安全性、规模还是?
回答by Clay
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.
如果您需要商业支持,请选择 NServiceBus。如果您对使用论坛作为支持方式感到满意,MassTransit 是一个不错的选择。到目前为止,开发人员对我们的问题非常敏感。如果您选择 MassTransit,现在您将在 MSMQ 和 RabbitMQ 之间进行选择。如果您需要 DTC,请使用 MSMQ。如果您想要更多功能和更好的管理,请使用 RabbitMQ。
On our project, we switched from NServiceBus to MassTransit for two reasons:
在我们的项目中,我们从 NServiceBus 切换到 MassTransit 有两个原因:
- MassTransit is free
- We love RabbitMQ
- 大众运输是免费的
- 我们爱RabbitMQ
I've used both frameworks. I've used MassTransit longer than NServiceBus. Here are the highlights as I see them.
这两个框架我都用过。我使用 MassTransit 的时间比 NServiceBus 长。以下是我所看到的亮点。
Cost:
成本:
- MassTransit is Apache 2.0 licensed and free for commercial production use, whereas NServiceBus is not.
- MassTransit 是 Apache 2.0 许可的,可免费用于商业生产,而 NServiceBus 不是。
Support:
支持:
- As Udi mentioned, there is an option for commercial NServiceBus support, I haven't seen that for MassTransit.
- 正如 Udi 提到的,有一个商业 NServiceBus 支持选项,我还没有看到 MassTransit 支持。
Transport:
运输:
- MassTransit supports MSMQ and RabbitMQ
NServiceBus supports only MSMQRabbitMQ is supported in NServiceBus 4+
- MassTransit 支持 MSMQ 和 RabbitMQ
NServiceBus 仅支持 MSMQRabbitMQ 支持 NServiceBus 4+
RabbitMQ vs MSMQ:
RabbitMQ 与 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
- MSMQ 支持 DTC(分布式事务协调器),用于涉及潜在多台机器(例如 SQL 服务器、Windows 服务)上的多个进程的事务
- RabbitMQ 有一个优秀的管理界面
- MSMQ 已经存在更长时间并且是 Microsoft 产品
- RabbitMQ 更新、开源、免费,由 VMWare 赞助
- MSMQ 默认安装在大多数 Windows 机器上
Udi Dahan and the MassTransit guys (Chris Patterson, Dru Sellers, and Travis Smith) are all brilliant people.
Udi Dahan 和 MassTransit 的人(Chris Patterson、Dru Sellers 和 Travis Smith)都是才华横溢的人。
回答by Udi Dahan
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.
作为 NServiceBus 的原作者,我可能有点偏向于我自己的技术,但我会尽量保持平衡。
Both NServiceBus and MassTransit support RabbitMQand Azure Service Bus, but NServiceBus also supports:
NServiceBus 和 MassTransit 都支持RabbitMQ和Azure Service Bus,但 NServiceBus 也支持:
On the topic of RabbitMQ
关于RabbitMQ的话题
The argument could be made that NServiceBus has stronger support for RabbitMQ - for example, in its delayed delivery functionalitywhile Mass Transit statesthat their "plugin is still considered as experimental. It is supported by MassTransit, but we cannot guarantee anything more than the plugin guarantees itself."
可以说 NServiceBus 对 RabbitMQ 有更强的支持——例如,在其延迟交付功能方面,而 Mass Transit表示他们的“插件仍然被认为是实验性的。MassTransit 支持它,但我们不能保证比插件更多的东西保证自己。”
We also work very closely with the RabbitMQ team, contributing to the .net SDKfor the benefit of the whole ecosystem.
我们还与 RabbitMQ 团队密切合作,为 .net SDK 做出贡献,造福整个生态系统。
When it comes to Azure Service Bus
谈到 Azure 服务总线
The level of collaboration we have with the Azure Service Bus team is even higher, with over 70 PRs to their .net core SDK.
我们与 Azure 服务总线团队的协作水平更高,他们的 .net 核心 SDK 有超过 70 个 PR。
When you use NServiceBus, you benefit from the full depth of that knowledge.
当您使用 NServiceBus 时,您将从该知识的全部深度中受益。
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 Sourceto 3rd party tools like Application Insights or Open Trace.
一旦您构建了一个实质性的系统,了解所有不同的移动部件如何相互通信就变得非常重要。除了通过诊断源与 Application Insights 或 Open Trace 等 3rd 方工具进行小规模集成之外,MassTransit 在该领域没有太多内容。
The Service Platform around NServiceBus goes quite a bit farther, giving you the ability to see sequence diagrams across all endpoints with ServiceInsight:
围绕 NServiceBus 的服务平台走得更远,使您能够使用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.
这是 MassTransit 所没有的另一个领域。当您正在集成的第 3 方系统变得不可用并且系统中的一堆消息最终进入错误队列时,MassTransit 唯一的解决方案是让您稍后使用RabbitMQ Shovel 插件手动将这些消息移回。
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 successfullyall in a simple web app called ServicePulse.
围绕 NServiceBus 的服务平台包括对该错误队列的监控、用于查看这些错误原因的图形工具,以及重播这些失败消息组并查看它们是否在一个简单的 Web 应用程序中实际成功处理的能力称为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 monitoringavailable 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 Gitteror 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.
尽管 Mass Transit 的人一直非常擅长帮助任何在Gitter或他们的Google Group上有疑问的人,但我认为他们不会提供旧版本的错误修复。当您的生产系统已经存在了几年,并且您不能一直升级所有东西时,这开始变得很重要。
With NServiceBus support includes:
NServiceBus支持包括:
- 2+ years for each major version
- An additional 2 years of extended support
- Guaranteed response times on critical issues
- 24x7 availability
- 每个主要版本 2 年以上
- 额外 2 年的扩展支持
- 保证关键问题的响应时间
- 24x7 可用性
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.
从线下的角度来看,NServiceBus 上有世界各地的公共课程以及许多可以被带到现场以启动项目或在出现问题时提供帮助的顾问。我听说有几家公司决定从 MassTransit 切换到 NServiceBus,因为他们无法在需要时派人到现场。
Licensing
许可
What some people still don't know about NServiceBus is that it is FREE for personal use and startups.
有些人仍然不知道 NServiceBus 是免费供个人使用和初创公司使用的。
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.
在商业用途方面,围绕 NServiceBus 的许可模式非常灵活,正如广泛的客户所表明的那样,并且可以很好地证明管理的合理性。当然,对于 MassTransit,许可是免费的。
Hope that helps in some way.
希望在某种程度上有所帮助。
回答by mookid8000
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(我碰巧是其主要作者)。
Rebus is about 8 years old now, and it has been used to move money around and control power plants from the get-go.
Rebus 现在大约 8 岁了,它从一开始就被用来转移资金和控制发电厂。
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.
它支持大多数基本的排队系统,如 MSMQ、RabbitMQ、Azure 服务总线、Azure 存储队列、Amazon SQS 等,但它也支持更有趣的东西,如使用 MSSQL、PostgreSQL 和 Oracle 作为传输。
The documentation wikiis fairly comprehensive, although many people seem to get by, because Rebus' APIs are so easily discoverable.
文档 wiki相当全面,尽管很多人似乎都接受了,因为 Rebus 的 API 很容易被发现。
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.
Rebus 一直(并将永远)完全免费。它已获得 MIT 许可,因此您基本上可以随心所欲地使用它。
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).
如果您最终成为 Rebus 的忠实用户,并且需要正式的支持协议和额外的工具,您可以订阅Rebus Pro,它由Rebus FM(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.
上面提到的“额外工具”目前以Fleet Manager的形式出现,它可以帮助解决问题。例如,Fleet Manager完全替换了错误队列,因此失败的消息会存储在那里。这意味着只需在 Fleet Manager 中单击几下,即可随时查看、管理和重试失败的消息。
回答by Eben Roux
You could always use Shuttle (FOSS): https://github.com/Shuttle/shuttle-esb:)
你总是可以使用 Shuttle (FOSS): https://github.com/Shuttle/shuttle-esb:)
Documentation (always improving): http://shuttle.github.io/shuttle-esb/
文档(不断改进):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.
Shuttle 项目已经进行了将近 2 年,并使用了生产系统。这将是一个选择与你产生共鸣的问题。
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).
NServiceBus 有着良好的记录。我以前在生产系统 (1.9) 上使用过它,但自从它商业化后就没有使用过(我开始使用 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.
我想您的所有选项都将具有基础知识(命令/事件/发布订阅)。然而,NServiceBus 确实有传奇和数据总线的东西,尽管我认为处理服务总线本身之外的数据很容易,比如在你的端点消息处理程序中。我不知道 MassTransit 是否有传奇/数据总线,但 Shuttle 肯定没有。
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.
另一个考虑因素可能是您打算如何使用服务总线。如果它是产品的一部分,那么对于像 NServiceBus 这样的商业选项,您需要考虑对产品用户的成本影响,虽然它仍然是内部开发需要考虑的事情,但肯定可以有道理。


