0
votes

I am trying to find the right place to set a batch size for my queue trigger. Basically all these properties.. "batchSize": 1, "maxDequeueCount": 2, "maxPollingInterval": 5000,

When I checked this article, https://docs.microsoft.com/en-us/azure/azure-functions/functions-host-json

It does not talk about setting up configurations for queue triggers in host.json.

I have the following trigger which I only need fired one at a time, so batch size 1.

The name of the queue is saved in my local.settings.json in variable called "DispatchQueueName"

public static void OnFieldDevicePollingRequest_Run([QueueTrigger("%DispatchQueueName%", Connection = "AVStorageAccessKey")]string myQueueItem, ILogger log)
        {
            log.LogInformation($"Start Queue trigger function processed: {myQueueItem}");
            log.LogInformation($"C# Queue trigger function processed: {myQueueItem}");
        }

I am using .net core and need help with this soon please.

1
The host.json metadata file contains global configuration options that affect all functions for a function app.Other function app configuration options are managed in your app settings.Joey Cai

1 Answers

3
votes

It does not talk about setting up configurations for queue triggers in host.json.

You could set below configuration in host.json.

{
    "version": "2.0",
    "extensions": {
        "queues": {
            "maxPollingInterval": "00:00:02",
            "batchSize": 1,
            "maxDequeueCount": 2
        }
    }
}

The output is as below:

enter image description here

For more details, you could refer to this article.