---
id: bookworm.{env}.notification.dead-letter-queue
name: Notification Dead Letter Queue
version: 1.0.0
type: topic
summary: |
  Kafka dead-letter topic owned by the platform team that captures order
  notification commands that Notification API could not deliver.
owners:
  - platform-engineering-team
badges:
  - content: Kafka
    backgroundColor: blue
    textColor: blue
  - content: Dead-Letter Queue
    backgroundColor: red
    textColor: red
address: bookworm.{env}.notification.dead-letter-queue
parameters:
  env:
    enum:
      - development
      - staging
      - production
    default: development
    examples:
      - development
      - staging
      - production
    description: BookWorm deployment environment.
deliveryGuarantee: at-least-once
protocols:
  - kafka
---

## Purpose & Scope

This dead-letter channel captures order lifecycle email commands that [[service|notification-api]] failed to process. Records land here after bounded SMTP/MailKit retries and listener cooldowns are exhausted, or immediately upon template/deserialization failures.

## DLQ Profile

| Property                          | Value                                                                                                                                                                               |
| :-------------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Owning Service**                | [[service\|notification-api]]                                                                                                                                                       |
| **Address Pattern**               | `bookworm.{env}.notification.dead-letter-queue`                                                                                                                                     |
| **Upstream Source Channels**      | [[channel\|bookworm.&#123;env&#125;.finance.place-order]], [[channel\|bookworm.&#123;env&#125;.finance.complete-order]], [[channel\|bookworm.&#123;env&#125;.finance.cancel-order]] |
| **Routing Triggers**              | Exhausted SMTP/provider retries or immediate poison/deserialization/rendering errors                                                                                                |
| **Retention / Inspection Window** | Governed by Kafka broker retention policy; inspect and triage before broker expiry                                                                                                  |
| **Replay Safety**                 | Requires manual validation — check mail provider logs to avoid duplicate customer emails                                                                                            |

## Triage & Replay Guardrails

:::warning
Before replaying any record from this DLQ:

1. Check [[service|sendgrid-api]] (mail provider) activity logs first — an SMTP timeout may have occurred _after_ the provider already accepted the email.
2. Verify that the 24-hour message-ID deduplication cache behavior is understood; replaying a newly issued command ID can send a duplicate email.
3. **Never replay [[command|PlaceOrderCommand]] to [[channel|bookworm.&#123;env&#125;.finance.place-order]]** to recover email alone, as [[service|basket-api]] also consumes that topic.
4. Keep customer names and email addresses out of incident notes; correlate using `orderId` and message IDs only.

Follow the operational triage procedures in [[doc|operational/003-incident-response-and-runbooks]].
:::

<Accordion title="Retention & Privacy Notes">
	- **PII sensitivity:** Dead-lettered payloads contain customer contact fields (`fullName`,
	`email`). Restrict DLQ inspection access to authorized operators. - **Preserved metadata:**
	Records retain the `orderId` Kafka partition key and original CloudEvents metadata.
</Accordion>

## Channel Details & Visualization

<ChannelInformation />

<NodeGraph />
