Azure Service Bus FIFO pattern
  • 24 Jun 2022
  • 1 Minute to read
  • Contributors
  • Comments
  • Dark
    Light
  • PDF

Azure Service Bus FIFO pattern

  • Comments
  • Dark
    Light
  • PDF

#ServerlessTips - Azure Service Bus
Author: Steef-Jan Wiggers Azure MVP

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.

Azure Service Bus FIFO Pattern

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 Azure Service Bus monitoring on messaging issues and how you can improve them.

Service Bus-1(2)


Was this article helpful?