-1

I have tried to send a message to the topic of Azure Service Bus but it is not having any subscribers for now and it was showing there is no matching subscription found for it. So I have created a temporary subscriber for that and sent the message successfully. So my question is it compulsory to having a subscriber to send the message to the topic?? Thanks for the help!

shubham
  • 41
  • 1
  • 6

1 Answers1

2

You do not have to have subscriptions under the topic to be able to publish messages. But in order to receive messages, subscriptions have to exist. Subscribers can come online later and fetch those events. Without subscriptions, subscribers will not get anything as the topic doesn't know what to retain and for whom.

rickvdbosch
  • 14,105
  • 2
  • 40
  • 53
Sean Feldman
  • 23,443
  • 7
  • 55
  • 80
  • In addition to this (correct) answer: I just created a brand new topic and successfully sent a message to it. _A topic subscription resembles a virtual queue that receives copies of the messages that are sent to the topic. Consumers receive messages from a subscription identically to the way they receive messages from a queue._ So if a topic has no subscriptions, posting messages to it essentially results in messages being lost. – rickvdbosch Apr 13 '22 at 08:50