Azure Service Bus
Azure Service Bus is a robust cloud messaging service built to enhance communication between applications and services within an organization.
It decouples applications and services, allowing message producers and consumers to operate independently without needing to be online simultaneously, thereby improving system resilience and scalability.
Being a Paas (Platform As A Service), users don`t need to worry about the infrastructure as the Azure takes care of it. For instance:
This solution enables businesses to exchange messages seamlessly, ensuring reliable and asynchronous communication across different system components. With features like message queues, topics, and subscriptions, Azure Service Bus facilitates efficient message routing and load balancing, supporting more scalable and streamlined application architectures.
Data and Messages
Data is exchanged between various applications and services through messages.
A message serves as a container that includes both metadata and the data itself. Data can be of any format - encoded , pdf, text, XML,Json etc.,
ASB covers the following messaging scenarios
Service Bus Concepts:
Queues:
Topics
While a queue is used for one to one communication, topics are useful in publish-subscribe scenarios.
One Topic can have multiple subscriptions . Subscription can be thought of a virtual queue . They hold the messges until the expiry limit is set.
A subscription can also have a filter to define the condition of the message it should receive.
Namespaces
Container for all the Service Bus entities.
It can have multiple queues and multiple topics.
Advanced features:
领英推荐
Message sessions:
Using Sessions, FIFO is guaranteed for Queues and Topics. This also helps to implement request-response pattern.
Auto-forwarding:
When enabled, the message in the queue is automatically forwarded to another queue using FIFO order. The queues are in the same namespace and not from another namespace.
Dead-Lettering Queue or Topic:
Secondary subqueue,
DLQ holds messages that can't be delivered to any receiver, or messages that can't be processed. These can be later removed to investigate.
Scheduled delivery:
Submit messages to a queue or topic for delayed processing.
Message deferral:
If the message need not be processed due to special circumstances in the application, it can be deferred to a later stage. So the message remains in the queue or topic but set aside for later processing.
Transactions:
Grouping one or more operations in a single transaction together in a scope.
Filters and actions:
Subscriptions in the topic can define which message they wanted to receive from the topic. This is implemented using the Filter - 2 types SQL and Correlation Filter.
Auto-delete on idle:
The queue will be deleted after specific idle time. This is useful when there is a traffic on the queue.
Duplicate detection:
If the same message is sent again during retry, this feature discards the duplicate message ensuring the consumer doesnt receive the same message.
Batch delete of Messages:
Delete the expired messages in batch.
Security:
Saas, RBAC and managed identities.
Geo-disaster recovery:
During the downtime of azure datacenter, this feature enables the data processing to continue
in a different region.