gpt4 book ai didi

azure - 使用 Windows Azure 服务总线进行消息路由

转载 作者:行者123 更新时间:2023-12-04 07:05:16 26 4
gpt4 key购买 nike

我花了几个小时来了解 Azure 服务总线架构。我特别想知道这种排队技术是否可以用于支持消息路由——类似于 RabbitMQ 的路由功能。 http://www.rabbitmq.com/tutorials/tutorial-four-python.html

We will use a direct exchange instead. The routing algorithm behind a direct exchange is simple - a message goes to the queues whose binding key exactly matches the routing key of the message.

In this setup, we can see the direct exchange X with two queues bound to it. The first queue is bound with binding key orange, and the second has two bindings, one with binding key black and the other one with green.

In such a setup a message published to the exchange with a routing key orange will be routed to queue Q1. Messages with a routing key of black or green will go to Q2. All other messages will be discarded.

寻找对服务总线架构有深入了解的人来推荐实现此类队列的最佳向量。

最佳答案

Windows Azure 服务总线主题和订阅允许您执行完全相同的操作:

enter image description here

让我们将图像与您的示例进行比较:

  • 直接交换 X 将是图像中的 DataCollection Topic
  • Q1 将是仪表板 订阅(过滤器设置为Redmond)
  • Q2 将是库存 订阅(没有过滤器,意味着它将接收所有消息)。

其实很简单。您的客户端向主题发送消息(类似于队列),并可以向该消息添加一些元数据(这可以用作绑定(bind)键)。现在您不再从主题本身读取消息,主题会将消息转发到所有订阅。要实现消息路由,您只需使用类似于 SQL 的语法对一个或多个订阅设置过滤器即可。

Python教程:How to Use Service Bus Topics/Subscriptions

关于azure - 使用 Windows Azure 服务总线进行消息路由,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13753384/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com