Microsoft Certified: Azure Developer Associate (AZ-204)Connect to and consume Azure services and third-party servicesMedium

A financial institution is developing a system where every transaction must be processed in a strict order for each customer. Messages for different customers can be processed concurrently, but messages for the same customer must be processed sequentially to maintain data consistency. Which feature of Azure Service Bus should be utilized to guarantee this behavior?

  1. ATopic Subscriptions
  2. BDead-letter Queue
  3. CMessage Sessions
  4. DMessage Filters
Show answer & explanation

Correct answer: C. Message Sessions

Azure Service Bus Message Sessions provide ordered handling of related messages. By assigning a SessionId to messages belonging to the same customer, Service Bus ensures that all messages with that SessionId are delivered to the same receiver and processed sequentially, maintaining strict order.

Why the other options are wrong

  • A. Topic Subscriptions allow multiple consumers but do not inherently guarantee ordered processing for related messages across a single consumer.
  • B. Dead-letter Queue is for messages that cannot be delivered or processed, not for ordering.
  • D. Message Filters allow subscribers to select specific messages, but do not guarantee ordered processing for a group of messages.

Azure Service Bus Message Sessions

A feature of Azure Service Bus that enables ordered and concurrent processing of related messages.

  • Guarantees FIFO delivery for messages within a session.
  • Ensures all messages for a session are processed by a single receiver.
  • Useful for scenarios requiring strict message ordering per entity (e.g., customer, order).

Memory trick: Service Bus Sessions keep related messages in a tidy, sequential line.

More Connect to and consume Azure services and third-party services questions