Chapter 5 · AZ-204: Developing Solutions for Microsoft Azure Connect to and Consume Azure and Third-party Services
Azure Queue Storage
20 practice questions · 5 marks weightage
Practice questions
- Question 1Q-A6F1A1See the answer and solution
A .NET worker retrieves a message from Azure Queue Storage and may need up to two minutes to process it. The worker calls ReceiveMessagesAsync with a two-minute visibility timeout. What is the purpose of this timeout?
- A.It permanently deletes the message after two minutes.
- B.It temporarily hides the message from other consumers; if it is not deleted before the timeout expires, it becomes visible again.
- C.It limits the message body to two minutes of processing time and then truncates the message.
- D.It delays the first delivery of the message for two minutes.
- Question 2Q-26488BSee the answer and solution
An Azure Queue Storage worker receives a message, but processing fails repeatedly because the message contains invalid data. The application wants to prevent the message from continually blocking normal processing. Which approach is most appropriate?
- A.Use the message's DequeueCount, and after a configured threshold, delete it from the source queue and store it in a poison-message queue for investigation.
- B.Reset the message's DequeueCount to zero by calling UpdateMessageAsync.
- C.Set the visibility timeout to zero so that no consumer can receive the message again.
- D.Increase the queue's metadata limit so that the message can be retried indefinitely without being returned.
- Question 3Q-0B6A6FSee the answer and solution
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.
- 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.
- Question 4Q-A6180FSee the answer and solution
A .NET application must place a 100 KiB document-related work item in Azure Queue Storage. What is the recommended design?
- A.Store the document in Blob Storage and enqueue a message containing its URI and required metadata.
- B.Enqueue the entire document because Azure Queue Storage automatically splits large messages.
- C.Convert the document to Base64 because Base64 removes the queue message size limit.
- D.Use multiple queues automatically created by Queue Storage for each part of the document.
- Question 5Q-F3635FSee the answer and solution
A legacy worker reads Azure Queue Storage messages and expects the message body to be Base64-encoded. Which C# code configures the Azure.Storage.Queues client correctly before sending a message?
- A.var options = new QueueClientOptions { MessageEncoding = QueueMessageEncoding.Base64 }; var client = new QueueClient(connectionString, "jobs", options); await client.SendMessageAsync("{"id":42}");
- B.var options = new QueueClientOptions { MessageEncoding = QueueMessageEncoding.None }; var client = new QueueClient(connectionString, "jobs", options); await client.SendMessageAsync("{"id":42}");
- C.var client = new QueueClient(connectionString, "jobs"); await client.EncodeMessagesAsync(QueueMessageEncoding.Base64);
- D.var client = new QueueClient(connectionString, "jobs"); await client.SendMessageAsync(Convert.FromBase64String("{"id":42}"));
15 more questions on Azure Queue Storage
Sign up free to practise the full chapter. Questions you get wrong come back until you've mastered them.
Start practising freeFree to start · No credit card needed