Skip to content

feat: DLQ redrive tooling (ADR-0026)#8

Merged
muhammetsafak merged 1 commit into
mainfrom
feat/redrive
Jun 19, 2026
Merged

feat: DLQ redrive tooling (ADR-0026)#8
muhammetsafak merged 1 commit into
mainfrom
feat/redrive

Conversation

@muhammetsafak

Copy link
Copy Markdown
Member

The operator tool the error-handling contract explicitly deferred: "Re-driving messages from the DLQ back to the source queue is an operator/tooling concern for v1." Implements ADR-0026.

What

Redrive(ctx, transport, dlq, opts) — reads dead-lettered messages off a DLQ and re-publishes each to its dead_letter.original_queue (or opts.ToQueue), reset for reprocessing: the dead_letter block is stripped and attempts reset to 0, while job, trace_id, data and meta are preserved verbatim.

  • ToQueue — sandbox/redirect replay (the v1 safe-replay answer).
  • DryRun — inspect and report the plan; every message is restored unchanged.
  • Select — pick which messages to redrive (by reason, URN, …).
  • Max — cap how many are pulled.

Drains-then-processes so restored messages aren't re-encountered; acks a DLQ message only after a successful re-publish; restores undecodable bodies rather than dropping them. Built on the existing Transport + codec — no new dependency, and the envelope stays frozen (GR-1).

Tests

8 tests via InMemoryTransport (to-source, sandbox, dry-run, select, max, publish-failure-restores, no-dead_letter fallback, undecodable restored). Coverage 93%, -race clean.

Follow-up

The Replay-Bypass guard (a bq-replay-bypass transport header surfaced to handlers so a replay can skip external side-effects) is a documented phase two — it touches the runtime + every transport, like ADR-0025's traceparent follow-up.

🤖 Generated with Claude Code

…R-0026)

Redrive(ctx, transport, dlq, opts): reads dead-lettered messages, resets each (strip dead_letter, attempts->0, preserve job/trace_id/data/meta) and re-publishes to its dead_letter.original_queue or a chosen ToQueue. Options: ToQueue (sandbox replay), Max, DryRun (inspect+restore), Select (filter). Drains-then-processes; acks a DLQ message only after a successful re-publish; restores undecodable bodies. Pure transport+codec, no new dependency. Replay-Bypass header is a documented phase two.
@muhammetsafak muhammetsafak merged commit b933ccb into main Jun 19, 2026
12 checks passed
@muhammetsafak muhammetsafak deleted the feat/redrive branch June 19, 2026 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant