- Print
- DarkLight
- PDF
Azure Service Bus FIFO pattern
- Print
- DarkLight
- PDF
One of the patterns easily supported by the Azure Service Bus is the ‘first-in-first-out’ (FIFO) pattern – which isn’t supported in the other queue service – Azure Storage Queues. To realise FIFO with the Azure Service Bus is to use sessions.
Any service (publisher) can create a session when sending a message to a queue or topic by setting the SessionId property. Subsequently, the session comes into existence when the queue or topic is session aware, which means you have set ‘Enable session’ when creating the queue or topic.
When a queue or topic is session-aware the first message with a SessionId kicks off the session with an unlimited duration in time. This means second message with a corresponding *SessionId *can come at any time. The application/service consuming the message with the SessionId do not have an indication when related set of messages start or end. However, when including a Label property, you can define the start, intermediate and end message. Furthermore, with a SequenceNumber property you can define the order.
The Microsoft docs further explain the session features and state. It’s important to know that Service Bus supports FIFO pattern and is the best option on Azure to serve that requirement.
Also, get insights into Turbo360 Azure Service Bus monitoring tool on messaging issues and how you can improve them.