Event hub event triggered azure function not triggering/consuming all incoming events to event hub

LMK 0 Reputation points
2024-06-26T12:44:59.61+00:00

Hi!

I have a Azure function app of type Python which is event hub event triggered.

The issue I am having is that it is partly consuming the incoming events to the event hub, but not all of them.

My event hub is getting in events from a IoT hub. The Event hub has 32 partitions. The only subscriber to the event hub is my Azure function app. It is successfully connecting, but are not consuming all events incoming to the event hub.

The Azure function app is configured with the host.json file as follows regarding the event hub trigger:

  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[3.*, 4.0.0)"
  },
  "extensions": {
    "eventHubs": {
      "batchCheckpointFrequency": 1,
      "eventProcessorOptions": {
        "maxBatchSize": 100,
        "prefetchCount": 100
      }
    }
  }


The function.json function is configured as follows:

  "bindings": [
    {
      "type": "eventHubTrigger",
      "direction": "in",
      "name": "AzureEventHubTrigger",
      "eventHubName": "EVH_NAME",
      "consumerGroup": "$Default",
      "cardinality": "many",
      "connection": "EVH_CONN_STR"
    }
]


Incoming data to the event hub is of size just under 192 MB, and out is 167 MB.

The function supports batching of events (processing multiple), but from the invocations I can see that the function almost every time only running with processing 1 and 1 event.

From traces i can see that the all of the partitions are being subscribed by the azure function. But some more frequent than others.

Stopping the IoT hub message routing to the event hub caused the following:

The partitions not being subscribed as frequent increased in number of processed events as the other partitions where emptied. This indicates for me that events in those partitions are being stuck at the the event hub and not being processed.

Python version: 3.9

azure-eventhub==5.11.6

azure-functions==1.18.0

Number of TU for the Azure function app: 1

Pricing tier: Premium V3

Anyone having experience with this issue, or a solution to my problem?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,552 questions
Azure Event Hubs
Azure Event Hubs
An Azure real-time data ingestion service.
585 questions
{count} votes