MassTransit在RabbitMQ中添加了什么? [英] What does MassTransit add to RabbitMQ?

查看:107
本文介绍了MassTransit在RabbitMQ中添加了什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MassTransit 之上进行构建与直接在RabbitMQ ?

我相信MassTransit提供的一个好处是类型"交换(按接口/类型发布订阅),因此与普通的RabbitMQ交换相比,消息的内容是非结构化的文本/blob,因此消息的内容是结构化的. /p>

MassTransit还提供哪些其他好处?

解决方案

MT在仅使用RabbitMQ的基础上添加的内容:

  • 多线程并发使用者
  • 消息序列化,包括接口和版本控制
  • 自动交换绑定,发布约定
  • Sagas,包括通过NHibernate保持的持久状态
  • 您的服务的性能计数器
  • 邮件标题
  • 故障处理

这些只是少数,有些比其他重要.总线可以承载您的使用者,处理程序,sagas并管理所有线程,这一事实可能是最大的优势,并且您可以在同一进程中承载多条总线.

序列化是下一个最大的好处,因为要弄清楚它可能很痛苦,而且要获得具有自动反序列化为类型(包括动态支持的接口类型)的基于接口的消息协定,这是巨大的.发布一个实现多个接口的类,并看到所有感兴趣的使用者异步接收他们的消息在生产中真是太棒了,因为可以将新的接口添加到生产者中,而下层的使用者也不会受到影响.

其中一些,您可以在中查看更多文档. http://masstransit-project.com/MassTransit/understand/additions-to-transport.html ,或提供最近的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?

解决方案

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 at http://masstransit-project.com/MassTransit/understand/additions-to-transport.html, or give the recent .NET Rocks! podcast a listen for some related content by yours truly.

这篇关于MassTransit在RabbitMQ中添加了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆