简体   繁体   English

Azure Service Bus中多个相同类型的消息

[英]Multiple messages of the same type in Azure Service Bus

I'm trying to get my head around Azure Service Bus functionality. 我试图让我了解Azure Service Bus功能。 I have an application deployed to different environments (dev, test, staging, etc.). 我已经将应用程序部署到不同的环境(开发,测试,暂存等)。 From what I have seen you can have only one message type per bus? 从我看到的情况来看,每条总线只能有一种消息类型? Does it mean that to support each environment I would need a separate instance of the service bus? 这是否意味着要支持每个环境,我都需要一个单独的服务总线实例? I'm using Masstransit and since it requires standard version of the service to run, I would have to pay significant money for each instance every month. 我正在使用Masstransit,并且由于它需要运行该服务的标准版本,因此我每个月必须为每个实例支付大量费用。 Is there any workaround? 有什么解决方法吗? Is using RabbitMQ instead my only option? 是使用RabbitMQ代替我唯一的选择吗?

It looks like you're mixing multiple things here. 您似乎在这里混了很多东西。 To be more specific - MassTransit topology and Azure Service Bus service. 更具体地说-MassTransit拓扑和Azure Service Bus服务。 If you deploy an endpoint for mutiple environments ( test and prod for example) to the same Azure Servie Bus namespace, it will obviously collide as MassTransit will use the same entities required for your endpoint for both test and prod . 如果将多个环境(例如, testprod )的端点部署到同一Azure Servie Bus命名空间,则显然会发生冲突,因为MassTransit将为testprod使用终结点所需的相同实体。

Instead of that, you should use a namespace per environment. 取而代之的是,您应该为每个环境使用一个名称空间。 Ie create 2 namespaces (for example project-test.servicebus.windows.net and project-prod.servicebus.windows.net ). 即创建2个名称空间(例如project-test.servicebus.windows.netproject-prod.servicebus.windows.net )。 This way you can deploy the same MassTransit endpoint that will create identical entities, but they will be segregated by namespace. 这样,您可以部署将创建相同实体的相同MassTransit端点,但是它们将按名称空间分隔。

To your concern about the cost - on the Standard tier you're paying a monthly fee for the service usage (plus all the message transactions, just to be clear), not number of namespaces you're creating. 出于成本方面的考虑-在标准层上,您需要每月支付服务使用费(加上所有消息事务,请注意),而不是要创建的名称空间数量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM