---
id: bookworm.{env}.rating.dead-letter-queue
name: Rating Dead Letter Queue
version: 1.0.0
type: topic
summary: |
  Kafka dead-letter topic owned by the platform team that captures Catalog
  compensation events that Rating 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}.rating.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 Catalog compensation events that [[service|rating-api]] could not process when attempting to remove orphaned feedback. Messages land here after transient database retries are exhausted, or immediately if a compensation payload is malformed.

## DLQ Profile

| Property                          | Value                                                                                            |
| :-------------------------------- | :----------------------------------------------------------------------------------------------- |
| **Owning Service**                | [[service\|rating-api]]                                                                          |
| **Address Pattern**               | `bookworm.{env}.rating.dead-letter-queue`                                                        |
| **Upstream Source Channels**      | [[channel\|bookworm.&#123;env&#125;.catalog.book-update-rating-failed]]                          |
| **Routing Triggers**              | Exhausted transient retries (database/network faults) or immediate poison/deserialization errors |
| **Retention / Inspection Window** | Governed by Kafka broker retention policy; inspect and triage before broker expiry               |
| **Replay Safety**                 | Idempotent if feedback is already removed; verify book absence first                             |

## Triage & Replay Guardrails

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

1. Confirm that the referenced book is still absent from [[service|catalog-api]] before replaying compensation. If the book now exists, investigate the projection mismatch instead of deleting feedback.
2. Verify [[service|rating-api]] database health and check whether the feedback record has already been removed (already-deleted feedback is a safe no-op).
3. Isolate poison or schema-incompatible records rather than replaying them blindly.

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

<Accordion title="Retention & Correlation Notes">
	- **Preserved metadata:** Records retain the `feedbackId` Kafka partition key, CloudEvents
	envelope, and failure diagnostics.
</Accordion>

## Channel Details & Visualization

<ChannelInformation />

<NodeGraph />
