feat(redrive): DLQ redrive tooling — safe replay (ADR-0026)#3
Merged
Conversation
Java mirror of babelqueue-go Redrive: Redrive.redrive(transport, dlq, opts) drains a DLQ and re-publishes each message (reset: strip dead_letter, attempts->0, preserve job/trace_id/data/meta) to its dead_letter.original_queue or opts.toQueue. Options all()/toQueue/max/dryRun/select. The codec-only core has no transport, so it works over a minimal Transport seam the caller implements (like the otel Sender). Drains-then-processes; acks only after a successful re-publish; restores undecodable bodies (a null-job envelope) and on publish failure. No new dependency; envelope frozen. Replay-Bypass header documented as phase two.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Java mirror of
babelqueue-goRedrive(ADR-0026) — the operator tool for replaying off the dead-letter queue.What
Redrive.redrive(transport, dlq, opts)drains a DLQ and re-publishes each message to itsdead_letter.original_queue(oropts.toQueue), reset for reprocessing: thedead_letterblock stripped andattemptsreset to 0, whilejob,trace_id,dataandmetaare preserved verbatim. Options viaRedrive.Options.all().toQueue(..).max(..).dryRun(..).select(..).The codec-only Java core has no transport, so
redriveworks over a minimalRedrive.Transportseam (pop/publish/ack) the caller implements over their broker — the same shape as theotelmodule'sSender. Drains-then-processes; acks a DLQ message only after a successful re-publish; restores undecodable bodies (a null-jobenvelope) and on publish failure. No new dependency; envelope frozen (GR-1).Tests / gate
8 tests via an in-memory transport (to-source + reset/trace preserved, sandbox, dry-run, select, max, publish-failure-restores, undecodable restored, no-dead_letter fallback).
mvn verify: 67 tests pass, JaCoCo ≥0.90 met, SpotBugs 0.Follow-up
The Replay-Bypass guard (a
bq-replay-bypasstransport header surfaced to handlers so a replay can skip external side-effects) is a documented phase two.🤖 Generated with Claude Code