---
id: bookworm.{env}.basket.delete-failed
name: Basket Delete Failed
version: 1.0.0
type: topic
summary: |
  Kafka topic owned by the contributor team carrying Basket API's explicit
  checkout cleanup failure outcome for Finance compensation.
owners:
  - commerce-fulfillment-team
badges:
  - content: Kafka
    backgroundColor: blue
    textColor: blue
  - content: Topic
    backgroundColor: teal
    textColor: teal
address: bookworm.{env}.basket.delete-failed
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 topic transports explicit business failure outcomes published by [[service|basket-api]] within the Shopping bounded context when a submitted basket cannot be deleted during checkout. [[service|order-orchestration]] consumes this signal to trigger compensating order soft-deletion without sending a customer email. Transient infrastructure exceptions during basket storage access are not published here; those route to [[channel|bookworm.&#123;env&#125;.basket.dead-letter-queue]].

## Channel Specification

| Property                               | Value                                                                     |
| :------------------------------------- | :------------------------------------------------------------------------ |
| **Bounded Context / Owner**            | [[domain\|shopping]] / [[team\|commerce-fulfillment-team]]                |
| **Channel Type**                       | Topic                                                                     |
| **Address Pattern**                    | `bookworm.{env}.basket.delete-failed`                                     |
| **Parameters**                         | `env` (`development`, `staging`, `production`; default: `development`)    |
| **Protocol & Envelope Format**         | Kafka + CloudEvents JSON (`application/json`)                             |
| **Partition Key & Ordering Guarantee** | Keyed by `orderId`; preserves per-order event ordering within a partition |
| **Delivery Semantics**                 | At-least-once                                                             |
| **Dead-Letter Channel**                | None (direct worker consumption by [[service\|order-orchestration]])      |

## Messages & Participants

| Message                                        | Type  | Producer                | Consumer(s)                      | Consumer Group               |
| :--------------------------------------------- | :---- | :---------------------- | :------------------------------- | :--------------------------- |
| [[event\|BasketDeletedFailedIntegrationEvent]] | Event | [[service\|basket-api]] | [[service\|order-orchestration]] | Finance orchestration worker |

## Ordering, Retries & Failure Handling

- **Partition-key ordering:** Records are partitioned by `orderId` so failure outcomes stay ordered with other lifecycle events for the same order.
- **Transient retries:** [[service|order-orchestration]] applies bounded retry/backoff on transient orchestration host or state faults.
- **Poison & failure posture:** Direct worker consumption has no dedicated service DLQ; inspect worker logs and order saga state before replaying, as replay can trigger order soft-deletion.
- **Consumer idempotency:** [[service|order-orchestration]] deduplicates repeated failure outcomes so the compensating transition is not applied twice.

## Channel Details & Visualization

<ChannelInformation />

<NodeGraph />

## Related Documentation

- [[service|basket-api]] — Basket cleanup producer
- [[service|order-orchestration]] — Finance saga consumer
- [[channel|bookworm.&#123;env&#125;.basket.delete-complete]] — Paired cleanup success topic
- [[channel|bookworm.&#123;env&#125;.finance.delete-basket-failed]] — Downstream compensation command topic
- [[flow|user-checkout]] — End-to-end checkout workflow
- [[doc|arc42/08-crosscutting-concepts/002-contracts-and-messaging]] — Messaging standards and idempotency rules
