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

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

问题描述

与直接在 MassTransit 之上构建有什么好处www.rabbitmq.com/">RabbitMQ?

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

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

MassTransit 还提供哪些其他好处?

What other benefits provided by MassTransit?

推荐答案

MT 在仅使用 RabbitMQ 之上添加的东西:

Things that MT adds on top of just using RabbitMQ:

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

这些只是少数,有些比其他更重要.总线托管您的消费者、处理程序、sagas 并管理所有线程这一事实可能是最大的优势,而且您可以在同一进程中托管多个总线.

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.

这些只是一些,您可以查看文档了解更多信息,或提供真正古老的 .NET Rocks!播客真正聆听您的一些相关内容.

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.

更新:YouTube 上有一个整个系列现在涵盖了 MassTransit.

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

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

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