You are developing a C# background service that processes large report generation requests from an Azure Queue Storage queue named report-jobs. Each report request payload can occasionally reach 150 KB in size. The background service takes up to 10 minutes to compile and upload each report. You must ensure that messages are successfully processed without exceeding Azure Queue Storage limits and that other instances of the background service do not attempt to process the same message concurrently. Which two actions should you perform? (Select two.)
- Upload the report request payload to Azure Blob Storage, and use the Blob URI as the queue message payload.Cevap
- Call QueueClient.ReceiveMessagesAsync and specify a visibilityTimeout of at least 10 minutes.Cevap
- CInitialize the QueueClient using QueueClientOptions with the maximum message size set to 256 KB.
- DGenerate a Shared Access Signature (SAS) token for the queue with full Manage permissions to authorize the background service.
- ERetrieve the messages using QueueClient.PeekMessagesAsync to prevent the visibility timeout clock from starting during processing.
Cevap
To resolve the limits and processing concurrency issues, you must upload the report request payload to Azure Blob Storage and use the Blob URI as the queue message payload, and call QueueClient.ReceiveMessagesAsync with a visibilityTimeout of at least 10 minutes.
The correct options are the ones that suggest uploading the payload to Azure Blob Storage and using the Blob URI as the queue message payload, and calling QueueClient.ReceiveMessagesAsync with a visibilityTimeout of at least 10 minutes. Storing the payload in Azure Blob Storage is necessary because Azure Queue Storage messages have a hard size limit of 64 KB, and the payload can reach 150 KB. Specifying a visibilityTimeout of 10 minutes ensures that the message remains invisible to other consumer instances while the background service processes the report, preventing duplicate processing.
Adım Adım Çözüm
Anahtar Kavram
Handling large payloads and visibility timeouts in Azure Queue Storage