Microsoft Certified: Azure Developer Associate (AZ-204)Connect to and consume Azure services and third-party servicesMedium
A development team is building a new microservices application. They need to implement a mechanism to reliably send messages between different services, ensuring that messages are delivered in order within a logical grouping and processed by only one consumer at a time. Which Azure messaging service feature should they use?
- AAzure Queue Storage messages
- BAzure Event Hubs partitions
- CAzure Event Grid topics
- DAzure Service Bus sessions
Show answer & explanationAnswer & explanation
Correct answer: D. Azure Service Bus sessions
Azure Service Bus sessions provide ordered delivery and single-consumer processing for messages belonging to a specific session. This is crucial for scenarios requiring sequential processing of related messages, such as those within a logical grouping like a customer order.
Why the other options are wrong
- A. Azure Queue Storage messages do not inherently guarantee ordered delivery or single-consumer processing for logical groupings without additional custom logic.
- B. Event Hubs partitions provide ordered delivery within a partition but do not enforce single-consumer processing or logical grouping.
- C. Event Grid topics are used for event distribution and do not guarantee ordered delivery or single-consumer processing for logical groupings.
Azure Service Bus Sessions
Azure Service Bus sessions enable sequential handling of related messages, ensuring ordered delivery and single-consumer processing for messages belonging to a specific logical grouping.
- Guarantees ordered message delivery within a session.
- Ensures exclusive processing by a single consumer for a session.
- Useful for scenarios requiring sequential processing of related messages (e.g., shopping cart items, workflow steps).
Memory trick: For sequential, single-delivery, think of a special bus route.