0

I have an Azure queue, and I am noticing that lots of messages come out all together. Is there a way that I can de-queue the messages maybe one at a time?

Also, how can I set the queue to process the items that go in the poison queue only two times rather than five times, which seems to the default right now.

Everywhere that I check, it talks about updating the function.json file which I don't even see in my Visual Studio instance. It seems like it gets configured at run time based on my settings in local.settings.json.

I have been updating only my local.settings.json file. My host.json only has version:2.0 in it.

Where can I change the configurations of my Azure queue?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Sarah
  • 1,199
  • 2
  • 21
  • 42

1 Answers1

1

Where can I change the configurations of my azure queue?

As the new case said, you could set the following configuration in host.json.

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

For more details, you could refer to this article.

Joey Cai
  • 18,968
  • 1
  • 20
  • 30
  • Thanks Joey for your help on this. If I had two queues and want different configurations for each one, how will this work? Like if I want batchsize of 2 for queue 1 and batchsize of 6 for queue 2. Is there a way to specify the name of the queue, these configurations are for? – Sarah Jun 14 '19 at 06:21
  • One more question, I used what you recommended and added them to host.json and published my functions to azure portal, how can I check to confirm that my batchsize in fact is 1. – Sarah Jun 14 '19 at 06:22
  • For the first question, it's no.The host.json metadata file contains global configuration options that affect all functions for a function app. So if you want host.json for different function, you have to have two function on azure. – Joey Cai Jun 14 '19 at 06:24
  • For the second one, you could go to appsettings to check the batchsize. Also, you could use Monitor to check it. – Joey Cai Jun 14 '19 at 06:51
  • webjob have Queue triggers with different batch sizes. You could refer to this [issue](https://stackoverflow.com/questions/52629666/azure-webjobs-queue-triggers-with-different-batch-sizes). – Joey Cai Jun 14 '19 at 10:13
  • Thanks @Joey.. I do have two separate functions in my function application in Azure. Function 1 trigger uses Queue 1 and Function 2 trigger uses queue 2. By "So if you want host.json for different function, you have to have two function on azure" Did you mean "you have to have two function APPS on azure" – Sarah Jun 16 '19 at 00:30
  • Not exactly. e.g. I have a joeyfunctionnet and under it have queue1 trigger and queue2 trigger. They are different functions but they share a `host.json` in `function app setting`. If so, you could not do it. If you have joeyfunctionnet and joeyfunctioncore which have each host.json, then you could achieve what you want. – Joey Cai Jun 17 '19 at 06:52