Azure Queue trigger for Azure Functions: configure minimum polling interval

3.6k Views Asked by At

I need to process a task queue and I wonder if Azure Queue will work for my case. Task execution implies querying a rate-limited API and for that reason I want polling to happen every X seconds (can be slower, but must not be faster than that). Azure Function app would consume queue messages with concurrency of 1.

In the host.json settings maxPollingInterval can be configured. For the minimum interval it says

Minimum is 00:00:00.100 (100 ms) and increments up to 00:01:00 (1 min)

Is there any way to force the required delay between polls?

1

There are 1 best solutions below

1
On BEST ANSWER

The azure queue may not meet your need. Here is the polling algorithm:

  • When a message is found, the runtime waits two seconds and then checks for another message
  • When no message is found, it waits about four seconds before trying again.
  • After subsequent failed attempts to get a queue message, the wait time continues to increase until it reaches the maximum wait time(maxPollingInterval), which defaults to one minute.

So it does not poll the queue every X seconds.

You may consider using timer trigger function which can be specified to run at every X seconds; and inside the function, you can write your logic to call the api.