Microsoft.ServiceBus.Messaging 与 Microsoft.Azure.ServiceBus [英] Microsoft.ServiceBus.Messaging vs Microsoft.Azure.ServiceBus
问题描述
MS 最近引入了 Microsoft.Azure.ServiceBus 命名空间.
https://github.com/Azure/azure-service-bus/blob/master/samples/readme.md
MS has recently introduced the Microsoft.Azure.ServiceBus namespace.
https://github.com/Azure/azure-service-bus/blob/master/samples/readme.md
它适用于新的 .net 标准 框架(好像 MS 没有足够的半冗余代码库)
It is geared for the new .net standard framework (as if MS doesn't have enough semi-redundant code bases)
我的问题是,它在性能方面能提高多少?
My question is, how much better could it be in terms of performance?
我可以自信地说,Microsoft.ServiceBus.Messaging 有很多不足之处,尤其是在持续接收方面.
I can say with confidence, that the Microsoft.ServiceBus.Messaging leaves lots to be desired, in particular when it comes to persistent receiving.
Microsoft.ServiceBus.Messaging 的一个非常有用的功能是消息泵,它建立在 OnMessage() 方法之上.
A very useful feature of the Microsoft.ServiceBus.Messaging , is the message pump, built on top of OnMessage() method.
新库没有这个,需要在每个收据上重新绑定事件处理程序以保持泵送.绝对是退步了.
The new library, doesn't have this, and needs to rebind event handlers on every receipt to keep pumping. Definitely a step backward .
寻求对两者都有经验并可以进行比较的任何人的反馈..
Looking for feedback from anyone who has had experience with both and can compare..
推荐答案
为了解决您的问题,.netstd 库提供了 .netframework one 中没有的内容:
To address your question, what .netstd library offers that was not in .netframework one:
- 开源.新库是完全开源的.您可以浏览、进入(使用下一个版本)而无需设置符号服务器、贡献并简单地查看工作原理.
- 与 .netframework 库相反,新库是真正异步的.
- 减少了职责和代码大小.例如,
Message
与BrokeredMessage
.您的数据不再由客户端序列化. - 默认为 AMQP,而不是 SBMP.
- 新客户端针对 .NET 标准和完整框架.
- 重新设计了某些客户端方面以提供更好的选项(OnMessage API 以提供更多失败上下文,插件和可扩展性、接口以便于测试).
- 经过全面测试一>.
- Open Source. The new library is fully open sourced. You can browse, step into (with the next release) without setting up symbols server, contribute, and simply review how things work.
- The new library is truly async as oppose to what the .netframework library was.
- Reduced amount of responsibilities and code size. For example,
Message
vsBrokeredMessage
. Your data is no longer serialized by the client. - AMQP by default and not SBMP.
- The new client targets .NET Standard and Full Framework.
- Certain client aspects redesigned to provide better options (OnMessage API to provide more failure context, plugins and extensibility, interfaces for easier testing).
- Fully tested.
在性能方面,如果不是更好,它应该与旧客户端相当.
Performance wise it should be on par with the old client if not better.
Microsoft.ServiceBus.Messaging 的一个非常有用的功能是消息泵,它建立在 OnMessage() 方法之上.
A very useful feature of the Microsoft.ServiceBus.Messaging , is the message pump, built on top of OnMessage() method.
您仍然拥有 OnMessage API,但已重命名为 RegisterMessageHandler
.
You still have OnMessage API, though renamed to RegisterMessageHandler
.
这篇关于Microsoft.ServiceBus.Messaging 与 Microsoft.Azure.ServiceBus的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!