Service Bus Topic Throttling
Problem
ION’s shared Service Bus namespace (ADR-0008) is a platform resource — one namespace, many producers, many topics, many subscribers. A misbehaving producer or a runaway domain event storm can:
- Saturate the namespace MRU budget, degrading every service.
- Overwhelm downstream consumers faster than they can process, causing DLQ growth and RU throttling on backing stores.
- Amplify through fan-out subscriptions — one hot message becomes N delivery attempts.
Throttling at the topic level protects the shared resource and shapes producer behaviour without giving each producer their own namespace (which would fragment the platform).
Solution
Combine producer-side rate limiting with consumer-side back-pressure and namespace-level quotas.
1. Producer-side rate limiting
- The platform SDK enforces per-producer send-rate caps per topic based on capacity model budgets.
- Bursts absorbed by a small in-process buffer; sustained
overrun blocks the producer’s
Send()call (natural back-pressure into the calling code). - Producers exceeding sustained caps trip a service-side alert — not silent throttling.
2. Consumer-side back-pressure
- Consumers use prefetch + concurrency bounds appropriate to their downstream processing capacity.
- Long-running message handling extends message locks; failure
DLQs after
MaxDeliveryCount. - Slow consumers naturally slow producer send-throughput through Service Bus’s built-in flow control.
3. Namespace-level quotas
- Per-topic MRU allocation documented and monitored.
- Namespace-level alerts on approaching the shared ceiling.
- Per-producer identity (UAMI) tagged in send operations for attribution.
4. Filter + fan-out discipline
- Consumers filter aggressively via SB SQL filters on
event
type— don’t receive events they don’t need. - Fan-out subscriptions are audited quarterly — remove stale subscribers.
When to use
- Every ION producer on the shared Service Bus (mandatory through the platform SDK).
- Especially: services whose input is bursty (Sentinel push, automation storms).
Consequences
Positive
- Shared namespace stays healthy under producer misbehaviour.
- Downstream consumers protected from stampedes.
- Cost + capacity visible per-topic + per-producer.
- Fits cleanly with DLQ and idempotency.
Negative
- Producer code must handle back-pressure (blocking or buffered send).
- Capacity planning per topic adds design work.
- Filter drift — stale filters continue to deliver unwanted events until cleaned up.
Failure modes
- No throttling — one producer takes down the shared namespace.
- Fire-and-forget in the presence of back-pressure — producer buffer overflows silently.
- Consumer prefetch too aggressive — messages locked and timing out before processing.
- Missing filters — fan-out to consumers who don’t need the event; wasted RU + processing.
References
- ADRs: 0008.
- Microsoft — Service Bus throttling, Premium messaging.
- Capabilities: Capacity, sizing, and scaling.
- Related patterns: DLQ, Idempotent Write, ECST.
Applied in
- Every producer on the shared Service Bus namespace (platform SDK)
- Watchtower Sentinel ingestion (bursty upstream)
- Cogs playbook completion emitters (potential storm on cascade)
- Pigeon notification request topic (with additional Pigeon-side throttling for Teams delivery — see Notifications)