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

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

Question

HOTSPOT - You are developing an Azure Function App by using Visual Studio.

The app will process orders input by an Azure Web App.

The web app places the order information into Azure Queue Storage.

You need to review the Azure Function App code shown below.

public static class OrderProcessor

{

[FunctionName("ProcessOrders") ]
public static void ProcessOrders([QueueTrigger("incoming-orders")]CloudQueueMessage myQueueItem, [Table(“Orders")]ICollector<Order> tableBindings, Traceliriter log)

{
log. Info($"Processing Order: {myQueueItem.Id}");
log. Info($"Queue Insertion Time: {myQueueItem. InsertionTime}") ;
log. Info($"Queue Expiration Time: {myQueueItem.ExpirationTime}") ;
tableBindings .Add(JsonConvert.Deserial izeObject<Order>(myQueueTtem.AsString)) ;
}

[FunctionName("ProcessOrders-Poison”)]
public static void ProcessFailedOrders ([QueueTrigger(“incoming-orders-poison™)]CloudQueueMlessage myQueueTtem, Tracellriter log)

{

log.Error($"Failed to process order: {myQueueItem.AsString}");

NOTE: Each correct selection is worth one point.

Hot Area:

Answer Area

The code will log the time that the order was processed from the queue.

When the ProcessOrders function fails, the function will retry up to five times
for a given order, including the first try.

When there are multiple orders in the queue, a batch of orders will be
retrieved from the queue and the ProcessOrders function will run multiple
instances concurrently to process the orders.

The ProcessOrders function will output the order to an Orders table in Azure
Table Storage.

Yes

No

Explanations

Answer Area

The code will log the time that the order was processed from the queue. [e) oO

When the ProcessOrders function fails, the function will retry up to five times ° [e)
for a given order, including the first try.

When there are multiple orders in the queue, a batch of orders will be ©) O°
retrieved from the queue and the ProcessOrders function will run multiple
instances concurrently to process the orders.

The ProcessOrders function will output the order to an Orders table in Azure ° [e)
Table Storage.

Box 1: No - ExpirationTime - The time that the message expires.

InsertionTime - The time that the message was added to the queue.

Box 2: Yes - maxDequeueCount - The number of times to try processing a message before moving it to the poison queue.

Default value is 5

Box 3: Yes - When there are multiple queue messages waiting, the queue trigger retrieves a batch of messages and invokes function instances concurrently to process them.

By default, the batch size is 16

When the number being processed gets down to 8, the runtime gets another batch and starts processing those messages.

So the maximum number of concurrent messages being processed per function on one virtual machine (VM) is 24

Box 4: Yes - Reference: https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-queue.