Azure Event Hub Source Node
The azureeventhubsource node consumes events from an Azure Event Hub. It runs Azure's EventProcessorClient, which balances partitions across all workers in the consumer group and persists partition offsets to a blob checkpoint store, so a restarted pipeline resumes where it left off.
Authentication uses either a SAS connection string or Microsoft Entra ID. The checkpoint store is required — it is what makes partition ownership and offset recovery durable.
Key Features
- Automatic partition balancing: the processor client claims and releases partitions cooperatively, so scaling workers up or down redistributes load without configuration changes
- Durable checkpointing: partition offsets live in an Azure Blob Storage container, so restarts resume from the last committed offset rather than re-reading the hub
- Backpressure: Azure delivers events by callback; they are queued into a bounded buffer, and a full buffer blocks the callback, slowing Event Hub delivery instead of growing memory
- Never checkpoints ahead of the pipeline: only offsets for events actually drained and returned downstream are committed
- Dual authentication: SAS connection string, or Entra ID via an explicit service principal or the ambient
DefaultAzureCredential - Partition key preserved: an event's Event Hub partition key is carried through as the record key
- Infinite streaming: never exhausts — runs until the pipeline is terminated
Configuration
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
eventHubName | String | Yes | — | Name of the Event Hub (topic) to consume from |
consumerGroup | String | Yes | $Default | Consumer group to read under. Each group gets an independent view of the stream |
connectionString | String | Conditional | — | SAS connection string for the namespace or entity. Mutually exclusive with fullyQualifiedNamespace |
fullyQualifiedNamespace | String | Conditional | — | Namespace host for Entra ID auth, e.g. my-namespace.servicebus.windows.net. Mutually exclusive with connectionString |
tenantId | String | No | — | Entra ID service principal tenant. Requires clientId, clientSecret and fullyQualifiedNamespace |
clientId | String | No | — | Entra ID service principal client id |
clientSecret | String | No | — | Entra ID service principal secret |
checkpointContainerName | String | Yes | — | Blob container holding checkpoint and partition-ownership data |
checkpointStorageConnectionString | String | Conditional | — | Connection string for the checkpoint storage account. Mutually exclusive with checkpointStorageEndpoint |
checkpointStorageEndpoint | String | Conditional | — | Blob endpoint for the checkpoint storage account, authenticated with Entra ID. Mutually exclusive with checkpointStorageConnectionString |
encodingType | String | Yes | — | Encoding of the event body. See Encoding Types |
initialPosition | String | No | EARLIEST | Where to start when a partition has no persisted checkpoint: EARLIEST or LATEST. Ignored once a checkpoint exists |
maxBufferedEvents | int | No | 1024 | Bound on events buffered between Azure's callback and the pull loop. A full buffer applies backpressure to Event Hub |
maxEventsPerFetch | int | No | 500 | Maximum events drained from the buffer per fetch cycle |
commitStrategy | String | No | BATCH | Checkpoint strategy: PER_RECORD, BATCH, or NONE |
commitBatchSize | int | No | 1000 | Records between checkpoints when commitStrategy is BATCH |
commitIntervalMs | long | No | 5000 | Milliseconds between checkpoints when commitStrategy is BATCH |
Authentication
Exactly one Event Hub authentication mode must be configured, and the checkpoint store is authenticated separately.
SAS connection string
Set connectionString and leave fullyQualifiedNamespace unset. The connection string may target the namespace or a single Event Hub entity.
config:
connectionString: "Endpoint=sb://my-namespace.servicebus.windows.net/;SharedAccessKeyName=listen;SharedAccessKey=..."
eventHubName: "telemetry"
Microsoft Entra ID
Set fullyQualifiedNamespace and leave connectionString unset. Supplying tenantId, clientId and clientSecret uses that service principal; all three are required together. Omit them to fall back to DefaultAzureCredential, which picks up a managed identity, environment variables, or a developer login.
config:
fullyQualifiedNamespace: "my-namespace.servicebus.windows.net"
eventHubName: "telemetry"
tenantId: "00000000-0000-0000-0000-000000000000"
clientId: "11111111-1111-1111-1111-111111111111"
clientSecret: "..."
Checkpoint store
checkpointContainerName is always required. Authenticate the storage account with either checkpointStorageConnectionString or checkpointStorageEndpoint (Entra ID) — providing both is rejected at validation time.
How It Works
Azure's EventProcessorClient is push-based, while ZephFlow sources are pull-based. The node bridges the two:
- The processor client claims a share of the hub's partitions and starts one delivery callback thread per owned partition.
- Each callback enqueues its event into a bounded buffer sized by
maxBufferedEvents. When the buffer is full the callback blocks, which propagates backpressure to Event Hub rather than accumulating unbounded memory. - The pipeline's polling thread drains up to
maxEventsPerFetchevents per cycle, deserializes each body usingencodingType, and emits the records downstream. - On commit, the offset of the latest drained event per partition is checkpointed to the blob container.
Because only dequeued events are eligible for checkpointing, the stored offset never runs ahead of what the pipeline actually received. On restart, each partition resumes from its checkpoint; initialPosition applies only to partitions that have none.
Commit strategies
BATCH(default): checkpoint aftercommitBatchSizerecords orcommitIntervalMsmilliseconds, whichever comes first. Best throughput.PER_RECORD: checkpoint after every record. Minimizes reprocessing on restart at a significant throughput cost.NONE: never checkpoint. Every restart re-reads frominitialPosition.
Delivery is at-least-once: events drained but not yet checkpointed are redelivered after a restart.
DAG Example
jobContext:
otherProperties: {}
metricTags: {}
dlqConfig:
dag:
- id: "source"
commandName: "azureeventhubsource"
config:
connectionString: "Endpoint=sb://my-namespace.servicebus.windows.net/;SharedAccessKeyName=listen;SharedAccessKey=..."
eventHubName: "telemetry"
consumerGroup: "$Default"
checkpointStorageConnectionString: "DefaultEndpointsProtocol=https;AccountName=mystorage;AccountKey=..."
checkpointContainerName: "eventhub-checkpoints"
encodingType: "JSON_OBJECT"
initialPosition: "EARLIEST"
maxBufferedEvents: 1024
maxEventsPerFetch: 500
commitStrategy: "BATCH"
commitBatchSize: 1000
commitIntervalMs: 5000
outputs:
- "sink"
- id: "sink"
commandName: "stdout"
config:
encodingType: "JSON_OBJECT"
Azure Setup
- Create an Event Hub in an Event Hubs namespace and note its name.
- Create a consumer group for this pipeline, or use
$Default. Give each independent consumer its own group so they do not compete for the same offsets. - Create a storage account and blob container for checkpoints. Do not share one container across unrelated pipelines consuming the same hub and group.
- Grant permissions: the Event Hub identity needs listen rights on the hub (
Azure Event Hubs Data Receiverfor Entra ID, or a Listen SAS policy); the storage identity needs read/write on the container (Storage Blob Data Contributorfor Entra ID).
Related Nodes
- azureeventhubsink: Publish records to an Azure Event Hub
- azureiothubsource: Consume IoT Hub device telemetry via its Event Hub-compatible endpoint
- kafkasource: Equivalent partition-balanced source for Kafka topics