Microsoft.ServiceBus中的BrokeredMessage类与Microsoft.Azure.ServiceBus中的Message类之间的区别 [英] Difference between BrokeredMessage class in Microsoft.ServiceBus and Message class in Microsoft.Azure.ServiceBus

查看:77
本文介绍了Microsoft.ServiceBus中的BrokeredMessage类与Microsoft.Azure.ServiceBus中的Message类之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开始使用Azure中的Azure Service Bus.经过Internet上的一些引用之后,人们似乎使用Microsoft.ServiceBus.Messaging中的 BrokeredMessage 类,而不是Microsoft.Azure.ServiceBus中的 Message 类.

I've got started with Azure Service Bus in Azure. Having gone through some references over the Internet, it seems that people use BrokeredMessage class in Microsoft.ServiceBus.Messaging rather than Message class in Microsoft.Azure.ServiceBus.

  • BrokeredMessage class: https://docs.microsoft.com/en-us/dotnet/api/microsoft.servicebus.messaging.brokeredmessage?view=azure-dotnet
  • Message class: https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.servicebus.message?view=azure-dotnet

我可以将两种消息类型"发送到Azure Service Bus,也可以通过Azure Service Bus使用它们.同样,两者都可以在异步操作中使用.两种类型的主要区别是什么?

I can send both of message 'types' to Azure Service Bus and also work with them over Azure Service Bus. Also, both can be used in Asynchronous operation. What are the main differences between the two types?

[更新]本文提供了在交换代理消息(

[Update] This article gives best practices of Azure Service Bus when exchaning brokered message (https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-performance-improvements). I'm unsure if it is also referred to Message in Microsoft.Azure.ServiceBus.

推荐答案

如果这是一个使用Azure Service Bus的新项目,我将建议以下内容:

If it's a new project to use Azure Service Bus, I would recommend the following:

  • 使用Message优先使用新的.NET Standard客户端(Microsoft.Azure.ServiceBus).
  • 请谨慎使用文档和各种资源.他们主要迎合了旧客户(希望MSFT doco很快改变).
  • 如果您需要跨不同实体的运输交易,那么新客户还不能提供它.
  • 如果您需要管理操作,则新客户端将不提供它.曾经.取而代之的是,您必须使用管理库或等到NamespaceManager的替代程序包出炉.
  • 如果您有旧系统以序列化数据的形式发送消息,而不是以Stream的形式发送,则使用新客户端的实现必须了解它,并使用客户端提供的扩展方法来处理这些消息.新客户端仅处理基于Stream的消息.
  • Prefer the new .NET Standard client (Microsoft.Azure.ServiceBus) with Message.
  • Be careful with documentation and various resources. They mostly cater to the old client (hopefully MSFT doco soon to change).
  • If you need transport transactions spanning different entities, the new client can't provide it yet.
  • If you need management operations, the new client won't provide it. Ever. Instead you'd have to use Management library or wait till a replacement package for NamespaceManager is out.
  • If you have old systems emitting messages sent as serialized data and not Stream, implementations using new Client have to know about it and use extension method provided by the client to process those messages. New client only deals with Stream based messages.

这篇关于Microsoft.ServiceBus中的BrokeredMessage类与Microsoft.Azure.ServiceBus中的Message类之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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