Notification delivery backlog
Diagnose and safely recover when unsent email records accumulate or stop progressing.
Trigger / Symptom & Blast Radius
Order emails are delayed, Kafka consumer lag grows on Finance order command topics, messages accumulate in <code>bookworm.{env}.notification.dead-letter-queue</code>, or Notification APIServicev1.0.0Notification APIInternal background worker that consumes order commands from Kafka, renders MJML email templates, and submits mail over ...SubscribesPlaceOrderCommand, CancelOrderCommand +1APIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs logs SMTP or Redis failures. Blast radius is transactional email delivery only; commercial order state in Order APIServicev1.0.0Order APIAuthenticated Ordering service for Buyer profiles and the Order lifecycle, creating Orders from baskets, snapshotting pr...PublishesGetBasketGrpc, GetBookGrpc +5SubscribesCreateOrder, CompleteOrder +11APIsOpenAPI, AsyncAPI, Carrier Service LevelsOwnercommerce-fulfillment-teamDiagramRepositoryOpen docs is unaffected.
Never flush BookWorm’s shared Redis instance during an outage, and never copy recipient email addresses or rendered HTML bodies into incident tickets.
Pre-Flight Check
Verify Notification APIServicev1.0.0Notification APIInternal background worker that consumes order commands from Kafka, renders
MJML email templates, and submits mail over ...SubscribesPlaceOrderCommand, CancelOrderCommand +1APIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs container status and stream recent logs in <ENV>:
az containerapp show --name <SERVICE_NAME> --resource-group <RESOURCE_GROUP> --query "properties.runningStatus" -o tsvaz containerapp logs show --name <SERVICE_NAME> --resource-group <RESOURCE_GROUP> --tail 150Quick Recovery Procedure
Measure Kafka lag and DLQ depth
Inspect consumer lag for the
notificationconsumer group across <code>bookworm.{env}.finance.place-order</code>, <code>bookworm.{env}.finance.complete-order</code>, and <code>bookworm.{env}.finance.cancel-order</code>, plus depth on <code>bookworm.{env}.notification.dead-letter-queue</code>. Record only lag counts, timestamps, and order/message IDs.Diagnose SMTP, resilience, or template faults
Check Notification APIServicev1.0.0Notification APIInternal background worker that consumes order commands from Kafka, renders MJML email templates, and submits mail over ...SubscribesPlaceOrderCommand, CancelOrderCommand +1APIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs logs for:
Circuit breaker open / 30s timeouts: SendGrid APIServicev1.0.0SendGrid APIExternal SMTP email delivery provider used by BookWorm to submit rendered order notification emails over authenticated S...Ownerplatform-engineering-teamDiagramOpen docs (or local Mailpit) unreachable or throttling on port
587.SMTP auth failures: Invalid SMTP username, password, or unverified sender address.
Redis errors: Idempotency store unreachable (24-hour deduplication guard).
Blank recipient email: Commands with blank/whitespace email addresses are intentionally skipped without error or DLQ entry.
Restore dependencies and replay DLQ messages
Fix the failing dependency (SMTP credentials/egress, Redis connectivity, or Kafka broker). Active lag drains automatically. For messages in <code>bookworm.{env}.notification.dead-letter-queue</code>, verify provider delivery logs first to minimize duplicates after ambiguous SMTP timeouts, then replay recoverable messages to their original Finance topic.
Verification
Confirm consumer lag on all three Finance command topics trends to 0, no new messages enter <code>bookworm.{env}.notification.dead-letter-queue</code>, and container logs show successful SMTP handoffs:
az containerapp logs show --name <SERVICE_NAME> --resource-group <RESOURCE_GROUP> --tail 50Rollback / Escalation
- Rollback: If a recent Notification APIServicev1.0.0Notification APIInternal background worker that consumes order commands from Kafka, renders
MJML email templates, and submits mail over ...SubscribesPlaceOrderCommand, CancelOrderCommand +1APIsAsyncAPIOwnerplatform-engineering-teamDiagramRepositoryOpen docs deployment introduced template rendering or SMTP config regressions, roll back to the previous Container App revision in
<RESOURCE_GROUP>. - Escalation: Escalate SMTP provider/credential issues to Platform Engineering TeamTeamPlatform Engineering TeamPlatform team providing BookWorm's thinnest viable platform—orchestration, messaging fabric, scheduling, notifications, ...Open docs; escalate template or handler defects to Platform Engineering TeamTeamPlatform Engineering TeamPlatform team providing BookWorm's thinnest viable platform—orchestration, messaging fabric, scheduling, notifications, ...Open docs.
Related documentation
- Notification DeliveryFlowv1.0.0Notification DeliveryFinance emits order-notification commands over Kafka; Notification API applies Redis idempotency, renders MJML email tem...Ownerplatform-engineering-teamView flowOpen docs — End-to-end notification delivery flow.
- ADR-003: Keep email delivery behind a MailKit SMTP provider boundaryDecision Recordv1.0.0ADR-003: Keep email delivery behind a MailKit SMTP provider boundaryNotification submits MIME messages through MailKit over SMTP, using MailPit in development and a configured provider els...Ownerplatform-engineering-teamOpen docs — SMTP provider boundary and resilience.