Background
Messages that exhaust all retries are published to flash-sale-orders.DLT, but they are never inspected or replayed. In production, a silent DLT is a data-loss risk — orders that failed to persist disappear without any reconciliation path.
Proposed Change
Add a dedicated DltEventConsumer that consumes from flash-sale-orders.DLT and writes records to a quarantine_events table.
Schema
-- V2__create_quarantine_events_table.sql
CREATE TABLE quarantine_events (
id BIGSERIAL PRIMARY KEY,
topic VARCHAR(128) NOT NULL,
partition INT NOT NULL,
"offset" BIGINT NOT NULL,
payload JSONB NOT NULL,
error_class VARCHAR(256),
error_message TEXT,
received_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
Admin replay endpoint
POST /api/v1/admin/quarantine/{id}/replay
Re-publishes the stored payload to the main topic so the normal consumer flow retries it.
Acceptance Criteria
Background
Messages that exhaust all retries are published to
flash-sale-orders.DLT, but they are never inspected or replayed. In production, a silent DLT is a data-loss risk — orders that failed to persist disappear without any reconciliation path.Proposed Change
Add a dedicated
DltEventConsumerthat consumes fromflash-sale-orders.DLTand writes records to aquarantine_eventstable.Schema
Admin replay endpoint
Re-publishes the stored payload to the main topic so the normal consumer flow retries it.
Acceptance Criteria
V2createsquarantine_eventsDltEventConsumerpersists every DLT message with error metadataflashsale.dlt.received_totalincremented per DLT message