Delivering Messages Made Easy With Azure Service Bus

Read it in 4 Mins

Last updated on
31st May, 2022
09th Aug, 2018
Delivering Messages Made Easy With Azure Service Bus

Integrating two different systems is often complicated and comes up with lots of challenges with respect to the availability of both systems, processing speed, scaling and many more. Amongst many recommendations for designing and developing applications for the cloud, enabling asynchronous communication between multiple services plays a vital role in achieving the reliability, scalability and the efficiency of the system.

What are Message Queues?

Message Queues is the solution to the challenges faced during Integration in distributed systems. It is an efficient way of enabling asynchronous communications between different software services.

Message Queues - Azure
Following are three most important benefits Queuing solution comes with:

1. Decoupling: Messaging queues provide a persistent storage and asynchronous communication and thus the availability of one service does not impact the another. They are eligible to work in a disconnected fashion.
Decoupling - Azure
2. High reliability: Messaging queues use transactions to manage the message and help to roll back the transaction to recover the message, In case of a failure.
High Reliability - Azure
3. Granular Scalability – Messaging queues helps to achieve granular scalability where the producer or consumer can scale on their own choice without even impacting the other.
Granular Scalability - Azure
Azure Service Bus – A managed Queuing system on Azure Cloud

Azure Service bus is a highly scalable service that helps to achieve asynchronous messaging and exchanging data among decoupled systems. Moreover, since it is a Platform as a Service (PaaS) offering from Microsoft, thus, you don’t have to manage the Infrastructure and configuration. Azure cloud manages all this for you.
Among all others, the most important feature of Azure Service Bus queue is that it guarantees messages to be delivered in FIFO order, which many other queuing solutions fail to provide, even Azure Storage Queues. This makes service bus the most suitable choice than any other Message Queues, though not the only choice. However, Other features to include high availability, auditing, Geo redundancy etc.

Azure Service Bus has 3 offerings:

1. Queues
2. Topics and Subscriptions
3. Relays
3 Azure Service Bus Offerings

1. Service Bus Queues:
The queue is an optimum choice when we are implementing one-directional messaging and, we want to ensure that only one consumer can fetch the message. This is generally used when both the producer and the consumer are not online at the same point in time. All the messages sent by the producer are stored in the queue until consumed by the consumer or gets expired. Also, each message in the queue is identified by a unique Message-ID.

Service Bus Queues - Azure
Queues come with the assumption that the message needs to be consumed by only one service. However, in practical scenarios, one message might need to be delivered to multiple consumers on some business decisions or need to be broadcasted. To meet those requirements Service bus does have a different offering, Topics.

2. Topics and Subscriptions:
Topics also provide one-directional communication. However, it works on the publish-subscribe principle where the same message can be consumed by more than one consumer. A single topic may have multiple subscriptions associated with it. A Subscription is somewhat like Queue. When the topic receives the message, it delivers it to all the relevant subscriptions or distributes based on the subscription filters.

3. Relays:
Unlike Queues and Topics, Relays provides more sort of bi-directional communication. Relays do not support brokered messaging i.e. they don’t store any messages instead simply passes the message from one service to the other. Therefore, both the publisher and subscriber need to be active at the same point in time in case of relays. Relays are automatically created and deleted in a service bus namespace i.e. they need not be created beforehand and deleted post use by services.

Azure Service Bus Architecture
The Azure Service Bus architecture is depicted in the figure below:

Some Important Limits and Quotas

Limit/Quota Name
Queue/topic size
1,2,3,4,or 5 GB
If partitioning is enabled -80 GB
Number of concurrent connections
Net Messaging:1,000
AMQP: 5,000
Number of topics/queues per service namespace
Number of partitioned topics/queues per service namespace
Basic and standard Tiers- 100
Premium- 1,000 {per messaging unit]
Message size for a queue/topicK
subscription entity
Maximum message size: 256 KB
[Standard tier} I 1 MB (Premier tier).
Number of subscriptions per topic

Advanced Features of Azure Service Bus

Azure Service Bus also has some advanced features that can help you to solve most complex messaging problems. The key features are listed below:

Advanced Features of Azure Service Bus
1. Dead Lettering
Service bus provides dead letter subqueue to store messages that could not be delivered or processed. Dead letter queues can be used to move expired or poisoned messages from the parent queue. Those messages then can be retrieved for further investigations. Dead letter queues need not be created manually but are automatically created with the queue.

2. Transactions
Service bus provides transactions to group multiple operations together into one execution scope. This ensures that all the operations within a group either succeed or fail together.

3. Duplicate detection
Enabling Duplicate detection helps to identify duplicate messages added on the basis of the unique message id. The duplicate message could be added by an application on restart of unexpected failure or exception scenarios not handled. Such messages need not be handled manually by the application because the service bus automatically handles those messages.

4. Batch processing
Batch processing feature of Azure service bus helps to add and retrieve messages in batch instead of one by one message. This extends help to the systems that have to process bulk messages.

5. Sessions
Sometimes the messages are bigger in size say more than 1 MB (maximum message size capacity of queues). Sessions help in such scenarios by sending the message in parts and allowing the processing of the same only when all the parts are received at the consumer end.


Microsoft’s PaaS offering, Azure Service Bus is really helpful in developing and implementing highly scalable services without even care about infrastructure. It provides asynchronous communication and ensures greater reliability.

Azure also lets you select from different options in service bus - for brokered and one directional message we have Queues and Topics and for non-persistent and bi-directional messages we have Relays.

Cloud Computing is the present and the future of Data storage. We hoped this article helped you get familiar with the services offered by the Microsoft Azure. If you want to know more about Cloud Computing and get certified, you can try the Microsoft Azure Certification offered by KnowledgeHut.


Varun Kumar

Blog Author

Varun Kumar is cloud consultant in Microsoft with more than 9 years of experience in IT and extensive experience in architecting cloud solution, developing highly scalable PaaS solutions using both Azure and AWS, migrating legacy on-premises applications to PaaS, leading high-performance teams and delivery management. He is author of multiple blogs that talks about latest technologies and solutions to challenges faced by cloud developers.

As a Cloud consultant and architect, his role includes providing cloud expertise to customers and designing scalable solution on cloud as per the business requirements.