Microsoft Certified: Azure Developer Associate (AZ-204)Develop for Azure storageMedium
A manufacturing plant uses Azure Queue Storage to process messages from factory sensors. Each message contains telemetry data that needs to be processed by a backend service. Due to intermittent network issues, the backend service occasionally fails to process a message completely. The developer needs to ensure that a failed message is automatically returned to the queue for reprocessing after a short delay, without immediately being available to other consumers.
- AIncrease the queue's maximum message size.
- BConfigure the message's visibility timeout.
- CImplement a dead-letter queue for failed messages.
- DSet the message's TimeToLive property to a short duration.
Show answer & explanationAnswer & explanation
Correct answer: B. Configure the message's visibility timeout.
The visibility timeout in Azure Queue Storage specifies how long a message remains invisible to other consumers after it has been dequeued. If the consumer fails to process and delete the message within this timeout, the message becomes visible again and can be reprocessed, which meets the requirement for automatic reprocessing after a short delay.
Why the other options are wrong
- A. Increasing message size is irrelevant to ensuring reprocessing of failed messages.
- C. A dead-letter queue is for messages that repeatedly fail processing, not for automatically returning a message to the main queue after a single intermittent failure.
- D. TimeToLive defines how long a message can remain in the queue before expiring, not its reprocessing behavior after a failed attempt.
Azure Queue Visibility Timeout
The visibility timeout in Azure Queue Storage determines how long a dequeued message remains invisible to other consumers. If the message is not deleted within this period, it becomes visible again for reprocessing.
- Controls message availability after dequeue.
- Used to handle intermittent processing failures.
- Default value is 30 seconds, maximum is 7 days.
Memory trick: Visibility is the key to retry success.