0

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?

mburm
  • 1,417
  • 2
  • 17
  • 37

1 Answers1

1

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.

Gaurav Mantri
  • 128,066
  • 12
  • 206
  • 241
  • Thanks. I figured it meanwhile out myself that I was looking all the time at the wrong spots. You can setup the filter in the subscription (somehow I haven't seen it before). But good to know that I should use unique subscriptions for each consumer and not share it even with same filter conditions. Thanks for that. – mburm Jun 08 '23 at 11:32