Logic App与Azure Service Bus主题筛选器

huangapple go评论69阅读模式
英文:

Logic App with Azure Service Bus Topics filter

问题

我有一个具有主题和订阅的服务总线。根据我的理解,我可以有多个使用相同订阅的消费者。

此外,我有一个逻辑应用(标准版),它将向主题发送消息,还有多个其他逻辑应用将消耗此主题。

但现在我需要对其进行过滤。因此,可能会有一些消息对所有消费者都感兴趣,但也有一些消息只对特定的逻辑应用感兴趣。

我在C#中找到了一些示例(基于自定义属性),但在逻辑应用中似乎找不到相关方法。是否有一种在逻辑应用中过滤主题消息的方法?

英文:

I have a Service Bus with a topic and a subscription. How I understand it I can have multiple consumers with the same subscription.

Additional I have a Logic App (Standard) which will send messages to a topic and multiple other Logic Apps which will consume this topic.

But now I have to filter on it. So it can be that a message is interesting for all consumers but there are also messages which are just interesting for certain Logic Apps.

I found examples in C# (based on custom properties) but somehow nothing to do it in Logic Apps. Is there a way to filter topic messages in Logic Apps?

答案1

得分: 1

看起来有一些误解。

我的理解是可以有多个使用相同订阅的消费者。

尽管在技术上可以有多个使用相同订阅的消费者,但这违背了初衷。一个订阅应该对应一个消费者。

例如,考虑一个电子商务系统,在下订单时会向一个主题发送一条消息。现在假设您想要向订单处理部门发送一条订单已经下达的通知,以及向客户发送他们的订单已被接收的通知。您为这两个流程创建了单独的消费者。现在,如果这两个消费者都监听同一个订阅,那么只有一个消费者能够获取消息并处理它。因此,如果客户通知消费者首先获取消息,那么订单处理部门可能无法收到通知,或者如果订单处理消费者首先获取消息,客户可能无法收到通知。

此外,我有一个 Logic App(标准版),将向一个主题发送消息,多个其他 Logic App 将消费此主题。

Logic App 应该监听订阅中的消息。当消息发送到主题时,根据过滤规则,消息会被路由到适当的订阅中。实际上,您甚至不能从主题中获取消息。

是否有办法在 Logic Apps 中筛选主题消息?

不行。消息应该只在 Service Bus 中进行筛选。它的工作方式是您在主题内的订阅上指定过滤规则。当消息发送到主题时,根据订阅上指定的过滤规则,消息将发送到适当的订阅中。

英文:

Seems there's a bit of misunderstanding.

> How I understand it I can have multiple consumers with the same
> subscription.

While technically it is possible to have multiple consumers with the same subscription but that defeats the purpose. For one subscription there should be one consumer.

For example, consider an e-commerce system where a message is sent to a topic when an order is placed. Now let's say you want to send a notification to the order processing department that an order has been placed and to the customer that their order has been received. You created separate consumers for these two processes. Now if both of these consumers listen to the same subscription, then only one of the consumer will be able to fetch the message and process it. Thus it might happen that the order processing department does not get notified if the customer notification consumer fetches the message first or the customer does not get notified if the order processing consumer fetches the message first.

> Additional I have a Logic App (Standard) which will send messages to a
> topic and multiple other Logic Apps which will consume this topic.

Logic App should be listening to messages in a subscription. When a message is sent to a topic, based on the filtering rules the messages are routed to appropriate subscriptions. In fact, you cannot even fetch messages from a topic.

> Is there a way to filter topic messages in Logic Apps?

No. The messages should be filtered in Service Bus only. The way it works is that you specify filtering rules on the subscriptions inside a topic. When a message is sent to a topic, the messages are sent to appropriate subscriptions based on the filtering rules specified on the subscription.

huangapple
  • 本文由 发表于 2023年6月8日 05:34:10
  • 转载请务必保留本文链接:https://go.coder-hub.com/76427248.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定