0

I have a Azure service bus Topic with two subscriptions. I want to send a message to topic from logic app using send message connector. How to send the message to a specific subscription. Now it takes only topic name and does not have property to accept subscription name, how can i implement the same.

thanks in advance.

killer
  • 1
  • 1

2 Answers2

1

Unfortunately, that is not possible (just not with logic apps, but in general)

This is how a topic and subscription works.

enter image description here

  • A Service Bus topic provides an endpoint for sender applications to send messages.

  • Each subscription of a topic gets a copy of the message sent to the topic.

Topics and subscriptions provide a one-to-many form of communication.

Having, said that you can configure filters at the Subscription end. This will facilitate receiving only those messages meeting the criteria from the central pool. When you want a specific subscription to receive it. You could send the message such a way that it matches the filter condition.

So, something like this :

enter image description here

Image Source

100 messages are sent to the topic, but are split to each subscription as 30,45,25 based on the filter rule. the messages that did not meet filter are not made available to the subscription.

In your case, you need set filters for both the subscription. Trigger the message such a way that it matches only for one of the subscription.

Alternatively, if it is going 1:1 - you could make use of the Queue.

References to set up filters at subscription level :

Filters Service Bus

Filtering the Service Bus

Stackthread on the implementation

Satya V
  • 3,811
  • 1
  • 6
  • 9
  • Please consider accepting this solution if it had helped :) https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work – Satya V Mar 25 '21 at 05:53
0

A subscription in Service Bus is an isolated view into the messages of a Topic, essentially a copy of the messages private to the subscription. This allows multiple consumers to process topic messages without competing with one another.

You can't publish messages messages directly to a subscription, only to the topic that the subscription is associated with. All subscriptions associated with the topic will have access to the message.

If you are looking to send messages for a single consumer (or a set of competing consumers), a Service Bus queue may be a better fit for your scenario.

Jesse Squire
  • 6,107
  • 1
  • 27
  • 30
  • Can filters be used to separate them into different subscriptions? – killer Mar 24 '21 at 15:19
  • A filter is applied on a subscription to limit the messages that the subscription will return when it is read from. You could set filters, yes. The downside to doing so is that you would have to set the appropriate filters on each subscription associated with the topic to tune what messages from the topic are exposed. An unfiltered subscription would see all messages published to the topic. – Jesse Squire Mar 24 '21 at 16:22