feat(redrive): DLQ redrive tooling — safe replay (ADR-0026)#3
Merged
Conversation
.NET mirror of babelqueue-go Redrive: Redrive.RedriveAsync(transport, dlq, options) drains a DLQ and re-publishes each message (Reset: strip dead_letter, attempts->0, preserve job/trace_id/data/meta via a record with-expression) to its dead_letter.original_queue or options.ToQueue. Options ToQueue/Max/DryRun/Select. The codec-only core has no transport, so it works over a minimal Redrive.ITransport seam (async pop/publish/ack). Drains-then-processes; acks only after a successful re-publish; restores undecodable bodies (a null-Job envelope) and on publish failure (try/finally). 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 .NET mirror of
babelqueue-goRedrive(ADR-0026) — the operator tool for replaying off the dead-letter queue.What
Redrive.RedriveAsync(transport, dlq, options)drains a DLQ and re-publishes each message to itsdead_letter.original_queue(oroptions.ToQueue), reset for reprocessing: thedead_letterblock stripped andattemptsreset to 0 (via a recordwith-expression), whileJob,TraceId,DataandMetaare preserved verbatim.OptionsareToQueue(sandbox),Max,DryRun,Select.The codec-only .NET core has no transport, so
RedriveAsyncworks over a minimalRedrive.ITransportseam (asyncPopAsync/PublishAsync/AckAsync) the caller implements over their broker. Drains-then-processes; acks a DLQ message only after a successful re-publish; restores undecodable bodies (a null-Jobenvelope) and, on a publish failure, restores viatry/finallybefore the error propagates. No new dependency; envelope frozen (GR-1).Tests / gate
8 xUnit tests via an in-memory
ITransport(to-source + reset/trace preserved, sandbox, dry-run, select, max, publish-failure-restores, undecodable restored, no-dead_letter fallback).dotnet test -c Release: 49 passed, 0 failed, analyzers +TreatWarningsAsErrorsclean.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