Microsoft Certified: Azure Developer Associate (AZ-204)Develop Azure compute solutionsMedium

A company is redesigning its backend infrastructure to use a message-driven architecture. They are using Azure Service Bus queues for reliable message delivery. A critical requirement is to prevent poison messages from indefinitely blocking the queue or being repeatedly processed, which could lead to resource exhaustion or data corruption. What Azure Service Bus feature should be configured to handle these problematic messages effectively?

  1. ADead-lettering
  2. BDuplicate detection
  3. CMessage deferral
  4. DMessage sessions
Show answer & explanation

Correct answer: A. Dead-lettering

Dead-lettering is the mechanism in Azure Service Bus that moves messages that cannot be processed successfully to a 'dead-letter queue'. This prevents poison messages from blocking the main queue and allows for their inspection and manual reprocessing or discard, ensuring the main application flow is not interrupted.

Why the other options are wrong

  • B. Duplicate detection prevents duplicate messages from entering the queue, not handling messages that fail processing.
  • C. Message deferral temporarily hides a message from the queue, allowing other messages to be processed, but the message will eventually return to the main queue.
  • D. Message sessions ensure ordered processing of related messages, not handling of poison messages.

Service Bus Dead-lettering

Azure Service Bus dead-lettering is a mechanism to move messages that cannot be delivered or processed successfully to a special 'dead-letter queue' (DLQ).

  • Prevents poison messages from blocking the main queue.
  • Messages are moved to DLQ after exceeding max delivery attempts or TTL.
  • DLQ messages can be inspected, re-submitted, or discarded.
  • Ensures application robustness and message flow integrity.

Memory trick: Dead-lettering: 'D'efectives 'L'eave 'Q'ueue.

More Develop Azure compute solutions questions