0

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://learn.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. Commented Jun 13, 2019 at 2:32

1 Answer 1

3

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.

Sign up to request clarification or add additional context in comments.

4 Comments

Thank you so very much @Joey, I have two another question.. 1) How can I specify the name of the queue in extensions. What if I have two functions monitoring two different queues and I want different specs for each?
1) Queue names are configured at the function level, in attributes (.NET) or function.json (everything else.) 2) Polling/batch/retry configuration is managed at the function app level, so you would need to move your queue triggered functions into separate function apps to configure different values.
As the comment I post before, the host.json metadata file contains global configuration options that affect all functions for a function app. So you could not specify for different queues.
I think the description of settings got moved here learn.microsoft.com/en-us/azure/azure-functions/….

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.