Skip to main content

Module dlq_replay

Module dlq_replay 

Source
Expand description

faucet dlq — inspect, replay, and discard dead-letter-queue envelopes.

The DLQ subsystem writes a fixed-shape envelope (faucet_core::dlq) for every quarantined row. This module closes the loop: read those envelopes back, group them by why they failed, re-feed the original payloads through the referenced pipeline (transforms → quality → contract → sink), and archive/delete what’s been handled.

Orchestration only — it produces serializable result structs and does IO, but never prints. The CLI command layer (crate::commands::dlq) renders them for the terminal; faucet serve renders them as JSON.

Modules§

plan
Pure planning for faucet dlq — validate a reason filter, derive the fresh “replay-failed” DLQ location, build the replay ExpandedNode, and decide per-line discard actions. Kept free of IO so it is exhaustively unit-testable; the IO shims live in mod and reader.
reader
Read a DLQ location (a local JSONL file, a directory of *.jsonl, or a glob) back into DLQ envelopes, and expose it as a Source so faucet dlq replay can feed the unwrapped original payloads through the normal pipeline path.

Structs§

DiscardOutcome
Outcome of a discard run.
EnvelopeSummary
A compact, serializable view of one envelope for the inspect sample.
InspectSummary
Grouped summary of a DLQ location, produced by inspect.
ReplayInputs
Inputs for a replay run beyond the config + location.
ReplayOutcome
Outcome of a replay run.

Functions§

discard
Discard (archive or delete) DLQ envelopes matching a reason / age filter.
inspect
Read a DLQ location back and group its envelopes by reason and error kind, with a bounded sample. reason restricts the included envelopes; malformed and non-envelope line counts always reflect the whole scan.
replay
Reconstruct a pipeline whose source is the DLQ location (envelopes → unwrapped payloads) and whose sink/transforms/quality/contract come from cfg, then run it through the normal executor path. Replayed rows that fail again land in a fresh DLQ so replay can never re-feed itself.