Azure Queue Storage · AZ-204: Developing Solutions for Microsoft Azure Connect to and Consume Azure and Third-party Services
A long-running .NET worker receives a message using Azure.Storage.Queues and needs to extend the message's invisibility while processing continues. W…
Practice question from Azure Queue Storage (AZ-204: Developing Solutions for Microsoft Azure Connect to and Consume Azure and Third-party Services), with the correct answer and a step-by-step solution.
hard · MCQ · Q-0B6A6F
A long-running .NET worker receives a message using Azure.Storage.Queues and needs to extend the message's invisibility while processing continues. Which action correctly extends the lease for the currently received message?
- A.Call UpdateMessageAsync(message.MessageId, message.PopReceipt, message.MessageText, TimeSpan.FromMinutes(5)) using the latest message ID and pop receipt.Correct answer
- B.Call SendMessageAsync with the original message text and a five-minute visibility timeout.
- C.Call DeleteMessageAsync with only the message ID, which automatically renews visibility before deletion.
- D.Call ReceiveMessagesAsync again with the same message ID and a five-minute visibility timeout.
Solution
UpdateMessageAsync can replace the message content and extend its visibility timeout. Deleting or updating a queue message requires the current pop receipt returned when the message was received; a later update produces a new pop receipt that must be retained for subsequent operations.
More from Azure Queue Storage
- A .NET worker retrieves a message from Azure Queue Storage and may need up to two minutes to process it. The worker calls ReceiveMessagesAs…
- An Azure Queue Storage worker receives a message, but processing fails repeatedly because the message contains invalid data. The applicatio…
- A .NET application must place a 100 KiB document-related work item in Azure Queue Storage. What is the recommended design?
- A legacy worker reads Azure Queue Storage messages and expects the message body to be Base64-encoded. Which C code configures the Azure.Sto…
Practise more Connect to and Consume Azure and Third-party Services
Sign up free for adaptive practice on this chapter, with instant feedback and hints on every question.
Start practising freeFree to start · No credit card needed