DR implementation: Service Bus
Tier: T0. Service Bus is the shared event backbone (ADR-0008). It carries commands and integration events. During recovery, it is the buffer that lets consumers pause without losing work.
Current configuration (prd)
| Setting | Value |
|---|---|
| Namespace | sbus-rome-prd-chn-01 |
| SKU | Premium, 1 messaging unit |
| Zones | Zone-redundant |
| Entities | Topics and subscriptions in each service’s Terraform. Most topics have prevent_destroy, and dead-lettering is on |
| Geo-disaster recovery | Not configured. It is a multi-region capability and out of scope |
Failure scenarios
| Scenario | Behaviour | Recovery | RTO and RPO |
|---|---|---|---|
| Zone loss | Premium replicates across zones. Clients reconnect | Automatic | Seconds to minutes. RPO 0 |
| Consumer down | Messages build up until their TTL expires, then they are dead-lettered | Recover the consumer, then drain | Consumer RTO. RPO 0 within the TTL |
| Poison messages | Dead-letter queue grows | Fix the handler, then re-submit from the dead-letter queue | Not applicable |
| Bad publisher | Invalid messages reach the consumers | Stop the publisher. Then dead-letter or skip the invalid messages, and replay from the event store if needed | Minutes to hours |
| Topic or subscription deleted | Publishing fails, or a consumer stops receiving. The messages in the entity are lost | Recreate from Terraform. Then republish from the source event store or the outbox | Deployment time. Messages that were in flight are lost |
| Namespace deleted | Every flow on the backbone stops. Every message in flight is lost | Recreate from Terraform. Then reconcile from the event stores | Hours |
| Throttling at 1 messaging unit | Higher latency and server-busy errors | Scale messaging units | Minutes |
Recovery procedures
Pause consumers for a data recovery
Owner: Owning service team
Disable the consuming functions or scale the Container Apps to zero. The publishers keep sending, and the messages wait in the subscription. Check that the TTL is longer than the expected recovery time. If it is not, raise it before the backlog expires.
Re-submit dead-lettered messages
Owner: Owning service team
Inspect the dead-letter reasons. Fix the handler first. Then move the messages back to the subscription with Service Bus Explorer, or with the service’s replay tool. Handlers are idempotent, so duplicates are safe.
Recreate a deleted entity
Owner: CPE with the owning team
Re-run the service Terraform to recreate the topic and its subscriptions. Then republish the affected window from the event store, using the replay procedures.
Drain at a controlled rate
Owner: Owning service team
Re-enable the consumers with limited concurrency. Watch the downstream store’s throttling and latency, and the active message count. Raise the concurrency step by step.
Rules
- The namespace MUST be Premium and zone-redundant in
prd. - Topics on T0 flows MUST have
prevent_destroy. The namespace MUST have aCanNotDeletelock. - Subscriptions MUST have dead-lettering on.
- The TTL on T0 subscriptions MUST be longer than the T0 RTO of 4 hours, so that queued work survives a recovery.
- Handlers MUST be idempotent.
Validation and drills
- Tabletop: walk through a deleted-subscription scenario and the replay path.
- In every PITR drill, pause and drain a real consumer, and measure the drain time.