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 - AzureFollowing 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 - Azure2. 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 - Azure3. 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 - AzureAzure 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. Relays3 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 - AzureQueues 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


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 Bus1. 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.

Summary

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.

Research & References of Delivering Messages Made Easy With Azure Service Bus|A&C Accounting And Tax Services
Source