Azure service bus is fully managed enterprise integration message broker. This service is most commonly used service to decouple the applications and services from each other. This service enables state transfer asynchronously between application and services.
In this article, we will quickly have a look at some basic concepts to understand Azure service bus.
There are three important terms which we need to understand before starting on Service Bus.
A namespace is a scoping container for all messaging components. Often namespaces are used as application containers. A single namespace can contain multiple queues or multiple topics.
Queues can be used to send and receive the messages. Queues can hold the messages until the receiving application is available for processing the message. The messages are held in redundant storage.
These messages are ordered and timestamped on arrival. These messages are made available when the consuming application requests (i.e. Pull mode).
Queues are used for point-to-point communication.
Topics can also be used to send and receive the messages.
Topics can have multiple, independent subscriptions. A subscriber to a topic can receive a copy of each message sent to that topic. Subscriptions are named entities, which are durably created but can optionally expire or auto-delete.
If you do not want all subscribers to read all the messages, then you can apply rules and filters for specifying additional actions to filter or to modify message properties.
Azure services bus has some advanced features. These features enable you to solve some complex messaging problems. Some of the key features are listed below:
- Message sessions: enable joint and ordered handling of unbounded sequences of related messages.
- Auto Forwarding: enables you to chain a queue or subscription to another queue or topic that is part of the same namespace.
- Dead Lettering: Dead letter queue is supported by service bus, to hold messages which could not be processed or could not be delivered. You can read these messages from DLQ and inspect them.
- Scheduled Delivery: you submit messages to queue or topic for delayed processing.
- Message Deferral: the option to defer retrieval of the message to a later point. The message remains in the queue or subscription, but it is set aside.
- Batching: You can delay sending message for specified interval of time. If any new messages were sent during this time, then they will be batched together.
- Transactions: Operation grouping is supported against a single messaging entity (queues, topics, subscriptions) within scope of transaction.
- Filtering and Actions: subscribers can define which messages they want to receive from a topic.
- Auto-Delete on Idle: you can specify idle duration (min it can be 5 min) after which the queue will be deleted automatically.
- Duplicate Detection: reduces burden on senders, they can send messages on their wish. Service Bus topics and queues can detect duplicates and can discard them.
- Geo-Disaster Recovery: in case of regions / data centers face downtime, service bus can still continue to work from other regions.
- RBAC, Managed Identities, SAS: are supported by Service Bus
- Security: supports standard AMQP 1.0 and HTTP/REST protocols.
I hope this article helped you to understand few basic concepts. In upcoming articles, we will have look at how Please do comment and let me know your thoughts.