Event Hubs Throttling
Problem
ION V3 has moved off Event Hubs as the primary event backbone (ADR-0008) in favour of Service Bus. Event Hubs is retained only as an integration adapter for external, high-volume push sources that speak the Event Hubs protocol — Microsoft Graph subscriptions, Sentinel / XDR ingestion streams, and similar.
Even in this narrow adapter role, throttling matters:
- Producers pushing at bursty XDR / Graph rates can exceed Event Hubs throughput unit (TU) limits.
- Consumers reading the stream must checkpoint frequently or risk unbounded rewind on restart.
- Partition skew from a hot tenant / source can wedge a single partition consumer.
- Failed ingestion silently accumulates unless surfaced with a matching DLQ path.
Solution
Treat Event Hubs as a bounded ingestion adapter, not a general-purpose bus.
1. Throughput unit sizing
- Provisioned TUs sized against the specific integration’s peak rate (per Capacity Model).
- Auto-inflate enabled to a documented ceiling — never unbounded.
- Alerts on approaching TU ceiling.
2. Partition strategy
- Partition count chosen against the parallelism ceiling of the consumer.
- Partition key selected to distribute load — typically
tenantIdor a hashed derivative; avoid natural keys that produce hot partitions. - Consumer group per bounded context — never share a consumer group across contexts.
3. Consumer discipline
- Checkpoint frequently — after each processed batch, not after each message; balance restart-cost vs. checkpoint overhead.
- Idempotent handlers — replays on restart must be safe (Idempotent Write).
- Backpressure via consumer concurrency bounds — do not fan out unbounded workers.
4. Adapter → Service Bus handoff
- The adapter’s job is minimal: read from Event Hubs, validate, wrap in the CloudEvents envelope, publish to Service Bus (event model).
- All downstream ION consumption happens on Service Bus, not on Event Hubs.
- This isolates upstream instability from the shared ION event backbone.
5. Failure surface
- Poison messages: publish to a failed-ingestion DLQ (Storage container or Service Bus DLQ topic) with metadata for triage.
- Monitor DLQ growth; alert on new patterns.
When to use
- Only for external systems that push via Event Hubs protocol: Graph subscriptions, Sentinel / XDR ingestion, partner high-volume streams.
- Not as a target for ION-internal event publication.
Consequences
Positive
- Preserves the ability to consume high-rate Microsoft ecosystem push channels.
- Isolates upstream instability inside the adapter — the ION event backbone (Service Bus) stays clean.
- TU sizing + partition strategy become explicit design decisions.
Negative
- Two message-substrate technologies to operate (SB + EH).
- Adapter code must be trusted and monitored.
- Partition rebalancing during scale operations can cause brief consumer stalls.
Failure modes
- Auto-inflate unbounded — cost surprise + potential to overwhelm downstream.
- Rare checkpoints — restart replays hours of messages.
- Hot partition — single consumer wedged; overall lag masked by healthy partitions.
- Adapter bypasses Service Bus — downstream consumers couple to Event Hubs directly, defeating the isolation.
References
references/Design Pattern- Eventhub Throttling.md- ADRs: 0008.
- Microsoft — Event Hubs throughput units, Auto-inflate.
- Related patterns: Service Bus Topic Throttling, DLQ, Idempotent Write.
Applied in
- Sentinel / XDR high-volume ingestion adapters (Watchtower)
- Microsoft Graph subscription push receivers (integration BFFs)
- Any planned partner high-volume ingest — must follow the adapter → Service Bus pattern