Microsoft Azure Data FundamentalsDescribe how to work with non-relational data on AzureMedium
A logistics company uses Azure Queue Storage to manage delivery orders. Each order is a message that needs to be processed by a fleet management system. The company needs to ensure that if a message fails to process due to a temporary issue, it is not lost and is re-queued for another attempt. Which message property or queue mechanism facilitates this requirement?
- AVisibility Timeout
- BMessage ID
- CDequeue Count
- DMessage TTL (Time to Live)
Show answer & explanationAnswer & explanation
Correct answer: A. Visibility Timeout
The 'Visibility Timeout' property in Azure Queue Storage specifies how long a message is invisible to other consumers after it has been dequeued. If the message is not successfully deleted within this timeout, it becomes visible again and can be re-processed by another consumer, ensuring temporary processing failures do not lead to data loss.
Why the other options are wrong
- B. Message ID is a unique identifier for the message, not a mechanism for retry logic.
- C. Dequeue Count tracks how many times a message has been dequeued, which can be used for dead-lettering, but doesn't directly re-queue.
- D. Message TTL defines how long a message can remain in the queue before being automatically deleted, not for re-queuing on failure.
Azure Queue Storage Visibility Timeout
A property in Azure Queue Storage that specifies the duration a dequeued message remains invisible to other consumers.
- Prevents multiple consumers from processing the same message simultaneously.
- If a message is not deleted within the timeout, it reappears in the queue.
- Essential for implementing retry logic for transient processing failures.
- Can be extended during processing to handle longer tasks.
Memory trick: Messages in a queue are like packages: send, get, process, deliver (delete), or return if issues.