---
id: bookworm.{env}.catalog.dead-letter-queue
name: Catalog Dead Letter Queue
version: 1.0.0
type: topic
summary: |
  Kafka dead-letter topic owned by the platform team that captures Rating
  feedback events that Catalog API could not process.
owners:
  - platform-engineering-team
badges:
  - content: Kafka
    backgroundColor: blue
    textColor: blue
  - content: Dead-Letter Queue
    backgroundColor: red
    textColor: red
address: bookworm.{env}.catalog.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 customer feedback integration events that [[service|catalog-api]] could not apply to book rating summaries. Messages are routed here when transient database or lock failures exhaust retries, or immediately when a payload is malformed. Note that a missing-book business condition on feedback creation is handled via [[channel|bookworm.&#123;env&#125;.catalog.book-update-rating-failed]] rather than dead-lettering.

## DLQ Profile

| Property                          | Value                                                                                                                      |
| :-------------------------------- | :------------------------------------------------------------------------------------------------------------------------- |
| **Owning Service**                | [[service\|catalog-api]]                                                                                                   |
| **Address Pattern**               | `bookworm.{env}.catalog.dead-letter-queue`                                                                                 |
| **Upstream Source Channels**      | [[channel\|bookworm.&#123;env&#125;.rating.feedback-create]], [[channel\|bookworm.&#123;env&#125;.rating.feedback-delete]] |
| **Routing Triggers**              | Exhausted transient retries (database/concurrency faults) or immediate poison/deserialization errors                       |
| **Retention / Inspection Window** | Governed by Kafka broker retention policy; inspect and triage before broker expiry                                         |
| **Replay Safety**                 | Requires manual validation of current book rating summary and feedback state                                               |

## Triage & Replay Guardrails

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

1. Verify [[service|catalog-api]] and [[service|rating-api]] health and confirm the underlying database or schema issue is resolved.
2. Check whether the feedback record still exists in Rating and whether the book's rating summary in Catalog already reflects the event.
3. Do not manually edit a book's rating summary as a substitute for replaying the authoritative event; isolate poison payloads before replaying valid records.

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

<Accordion title="Retention & Correlation Notes">
	- **Preserved metadata:** Records retain the original CloudEvents envelope, `bookId` Kafka
	partition key, and failure diagnostic context. - **Business compensation vs. DLQ:** When a newly
	rated book does not exist in Catalog, [[service|catalog-api]] emits
	[[event|BookUpdatedRatingFailedIntegrationEvent]] to
	[[channel|bookworm.&#123;env&#125;.catalog.book-update-rating-failed]] instead of sending the
	event here.
</Accordion>

## Channel Details & Visualization

<ChannelInformation />

<NodeGraph />
