简体   繁体   English

Azure 服务总线 SessionId 跨多个主题?

[英]Azure Service Bus SessionId across multiple topics?

ASB's SessionId can be used to guarantee ordering, for example if we have 5 messages which update an order, and 3 consumers running, the consumers won't process multiple messages for that order (SessionId = OrderId) at the same time. ASB 的 SessionId 可用于保证排序,例如,如果我们有 5 条消息更新订单,并且有 3 个消费者在运行,那么消费者不会同时处理该订单的多条消息(SessionId = OrderId)。

But suppose I have 3 topics:但假设我有 3 个主题:

  • CreateOrder创建订单
  • UpdateOrder更新顺序
  • DeleteOrder删除订单

If there are X messages spread across these 3 topics, all with the same SessionId, would the consumers for each topic pay any attention to the SessionId being used by other topics?如果有 X 条消息分布在这 3 个主题中,并且都具有相同的 SessionId,那么每个主题的消费者会注意其他主题正在使用的 SessionId 吗?

As in, if a message were being consumed by a CreateOrder consumer with SessionId=5, would the UpdateOrder consumer wait for this lock to release before picking up one of its own messages with SessionId=5?例如,如果 CreateOrder 消费者正在使用 SessionId=5 的消息,UpdateOrder 消费者是否会等待此锁释放,然后再获取它自己的一条 SessionId=5 的消息?

The sessions of different topics are independent and do not affect each other.不同主题的会话是独立的,互不影响。 In other words, when you receive messages with SessionId=1 in topic1, you also can receive messages with SessionId=2 in topic2.也就是说,当你在topic1中接收到SessionId=1的消息时,你也可以在topic2中接收到SessionId=2的消息。 For more details, please refer to the official document Azure Service Bus message sessions .更多细节请参考官方文档Azure Service Bus message sessions 在此处输入图像描述

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

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