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?

  1. A.Call UpdateMessageAsync(message.MessageId, message.PopReceipt, message.MessageText, TimeSpan.FromMinutes(5)) using the latest message ID and pop receipt.Correct answer
  2. B.Call SendMessageAsync with the original message text and a five-minute visibility timeout.
  3. C.Call DeleteMessageAsync with only the message ID, which automatically renews visibility before deletion.
  4. 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

All of Azure Queue Storage

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 free

Free to start · No credit card needed