Microsoft Certified: Azure Developer Associate (AZ-204)Connect to and consume Azure services and third-party servicesHard
A financial institution is developing a system where every transaction must be processed in the exact order it was initiated by a specific customer. Multiple customers can initiate transactions concurrently, but each customer's transactions must maintain strict sequential processing. Which Azure Service Bus feature enables this specific ordering requirement?
- ASessions
- BTopics with filters
- CDead-letter queue
- DMessage prioritization
Show answer & explanationAnswer & explanation
Correct answer: A. Sessions
Azure Service Bus Sessions are designed to handle ordered sequences of related messages. By assigning a SessionId to messages from a specific customer, all messages with that SessionId are guaranteed to be processed by the same receiver, in the order they were added to the session, ensuring strict sequential processing per customer.
Why the other options are wrong
- B. Topics with filters distribute messages but do not guarantee strict order for related messages consumed by a single subscriber instance.
- C. Dead-letter queues are for handling messages that fail processing, not for ensuring message order.
- D. Message prioritization impacts which messages are delivered first, but does not guarantee sequential processing for related messages.
Service Bus Sessions
A feature in Azure Service Bus that provides ordered handling of an unbounded sequence of related messages. All messages belonging to a session are processed by a single receiver, in order.
- Guarantees message order for a group of messages.
- Ensures messages from a session are processed by one receiver.
- Useful for conversational patterns or stateful workflows.
Memory trick: Service Bus Sessions are like a dedicated lane for each customer's messages, keeping them in perfect order.