Azure Service Bus Topic And Subscription (Pub-Sub)

Topic works like pub-sub model where one is the publisher and there can be many subscribers for the same publisher. In our scenario the publisher will publish offers and subscribed users will get the offers immediately.


Now let's see the step by step implementation of the below to design a solution:

  • Log in to the Azure portal via portal.azure.com

  • Explore previously created Service Namespace; i.e. Mobile Recharge

  • Click on '+Topic' under Topics to create a new topic

  • Give appropriate name for Topic

  • Keep the rest of the input values as is and click on 'Create' button

We can see that Topic is created in it is shown under topics list.


  • Click on previously created topic; i.e. 'Offers', which will show the list of subscriptions. As of now it shows empty

  • Click on '+Subscription' under subscriptions to create subscription

  • Give proper name of subscription

  • Change Lock duration to 5 minutes and click on 'Create' button, which will create subscription for topic

  • Follow the preceding steps and create one more subscription

We can see both the subscriptions in the list.



Credentials

Click on 'Shared access policies' from the left panel, click on 'RootManageSharedAccessKey' to