This article will cover the following.
- Brief concepts and prerequisites
- Implementation – Create a new Azure Service Bus
- Implementation – Adding a queue and accessing it from the Service Bus
Brief Concepts
What is Microsoft Azure Service Bus?
- It's a communication engine which provides secure and reliable communication between components.
- It allows you to build applications and connect with different roles between the web and worker TL. You can use this for load labeling and/or for decoupling where your web TS has sent messages into a queue.
- It provides you Messaging and Relay Services and really helps to unblock enterprise data as well as business logic.
- It provides multi-tenant service to the connecting applications.
Communication Mechanisms
- Queues- It allows one directional communications.
- Topics- It allows one directional communication using subscriptions.
- Relays- It’s responsible for providing bi-directional communications. It passes the messages on to destination application.
- Event Hubs- This is responsible to provide event and telemetry entry to the cloud
Prerequisites
Implementation – Create a new Azure Service Bus
Steps to be followed.
- Open Azure portal, click on "Add", and choose category “Enterprise Integration”. Then, select an option of “Service Bus”.
- Fill in the details. Use the existing resource-group and create a namespace within the Service Bus.
Implementation – Adding a queue and access it from the Service Bus
- Open the service-bus and click on the “Add Queue" button.
- Fill in the details based on the requirement and create a queue within the Service Bus.
- See the service-bus section, where we can see the newly created “Queue”.
- Add policies to the queue so that it can be accessible to the end-user. Here, create a “Write” policy with the send option.
- Add another policy into the queue so that it can be accessible to the end-user. Here, create a “Read” policy with the listen option.
- Click on the “Write” policy and see the “Primary connection string” there. Whatsoever would like to write anything into the queue, provide this connecting string along with the primary key to the person to access the same.
Happy Learning!