Why are not all messages processed by the Azure Function Queue Trigger?

Maryna Paluyanava 211 Reputation points
2024-07-15T22:19:56.5433333+00:00

Hello,

I have an Azure Function Queue Trigger. Messages are sent by another Azure function to the queue with a visibility_timeout parameter to postpone the processing of these messages:

queue_client.send_message(content=message, visibility_timeout=1200

My Azure Queue Trigger function takes these messages and loads the information into the Cosmos DB Gremlin API. I can see that all messages have been delivered to the queue; however, only 28 out of 61 were loaded into the database. There are no errors in the logs. It seems like other messages were skipped.

Could this be related to the host.json configuration? My host.json file looks like this:

{
  "version": "2.0",
  "functionTimeout": "00:10:00",
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": true,
        "excludedTypes": "Request"
      }
    }
  },
  "extensions": {
    "queues": {
        "maxPollingInterval": "00:00:02",
        "visibilityTimeout" : "00:03:00",
        "batchSize": 1,
        "maxDequeueCount": 5,
        "newBatchThreshold": 0,
        "messageEncoding": "base64"
    }
},
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[4.*, 5.0.0)"
  }
}

Or maybe this is related to a concurrent processing?
As the number of messages is large, I am going to load them in parallel.

Could anybody please help me understand why all messages are not being processed?

Many thanks

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,253 questions
Azure Queue Storage
Azure Queue Storage
An Azure service that provides messaging queues in the cloud.
110 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Maryna Paluyanava 211 Reputation points
    2024-07-16T06:45:25.8933333+00:00

    The issue has been resolved. The second function was processing messages concurrently.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.