Question 118 of 179 from exam AZ-204: Developing Solutions for Microsoft Azure

Question 118 of 179 from exam AZ-204: Developing Solutions for Microsoft Azure

Question

HOTSPOT - You are developing an application that uses Azure Storage Queues.

You have the following code:

CloudStorageAccount stoerageAccount = CloudStorageAccount . Parse
(CloudConfigurationManager .GetSetting ("StorageConnectionString”) ) ;
CloudQueueClient queueClient = storageAccount .CreateCloudQueueClient ();

CloudQueue queue = queueClient.GetQueueReference (“appqueue”);
await queue.CreateI£NotExistsAsync ();

CloudQueueMessage peekedMessage = await queue. PeekMessageAsync ();
if (peekedMessage != null)
{

Console.WriteLine (“The peeked message is: {0}”, peekedMessage.AsString) ;
}

CloudQueueMessage message = await queue.GetMessageAsync()

For each of the following statements, select Yes if the statement is true.

Otherwise, select No.

NOTE: Each correct selection is worth one point.

Hot Area:

Answer Area

Statement Yes
The code configures the lock duration for the queue. °
The last message read remains in the queue after the code runs. fe)

The storage queue remains in the storage account after the code runs. ©

No

Explanations

Answer Area

Statement Yes
The code configures the lock duration for the queue. °
The last message read remains in the queue after the code runs. @

The storage queue remains in the storage account after the code runs. |)

°

Box 1: No - The QueueDescription.LockDuration property gets or sets the duration of a peek lock; that is, the amount of time that the message is locked for other receivers.

The maximum value for LockDuration is 5 minutes; the default value is 1 minute.

Box 2: Yes - You can peek at the message in the front of a queue without removing it from the queue by calling the PeekMessage method.

Box 3: Yes - Reference: https://docs.microsoft.com/en-us/azure/storage/queues/storage-dotnet-how-to-use-queues https://docs.microsoft.com/en-us/dotnet/api/microsoft.servicebus.messaging.queuedescription.lockduration.