Repository navigation
feat(replay): bulk message replay / DLQ triage (UI, REST, CLI, MCP) - #5
Merged
Merged
Conversation
Implements F3 from the deep analysis — the README roadmap's message replay
promise: copy a filtered set of messages to another topic, on the same or a
different connected cluster.
- POST /api/clusters/{id}/topics/{topic}/replay: selects with the browser's
read-only scan (key/value-contains filters, oldest first, max 1000 per
call) and copies keys, headers and original timestamps preserved; dryRun
previews the selection without producing. Fail-fast on the first produce
error, with the source location in the error list.
- A real mutation, so the safety chain gates it for free: admin role only,
mutation audit trail, refused in global read-only mode.
- Web UI: Replay tab in the data explorer (target topic/cluster, filters,
dry-run checkbox).
- CLI: kview replay <topic> --to-topic T [--to-cluster ID] [--dry-run].
- MCP: kview_replay_messages with the same confirm=true guard as topic
delete — 19 tools now.
- browse improvement: the scan now stops as soon as every assigned partition
reaches its end offset instead of polling until the deadline — small
topics answer immediately (the browser test suite dropped from 34s to 15s).
- tests: 3 integration tests (same-cluster copy with header/timestamp
preservation, dry-run + filtered replay, cross-connection replay via a
second stored profile). Full suite 56/56.
This was referenced Sep 27, 2026
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.
Implements F3 — bulk message replay / DLQ triage from the deep analysis, fulfilling the README roadmap's "Message replay: copy a filtered set of messages to another topic or cluster". Stacked on #4 — merge #1 → #2 → #3 → #4 → this.
What it does
POST /api/clusters/{clusterId}/topics/{topic}/replayselects messages from a source topic (typically a DLQ) with the browser's read-only scan —keyContains/valueContainsfilters, oldest first — and produces them to a target topic on the same or a different connected cluster, preserving keys, headers and original timestamps (so offset-reset semantics stay meaningful after replay).dryRun: truepreviews the selection without producing — the recommended first step.reachedEndtells you whether the whole source was covered.partition@offsetin the error list, so a re-run with a narrowed filter can continue.Safety integration is free — replay is a real mutation, so the chain from #2/#3 applies automatically: admin role only in authenticated modes, every call lands in the mutation audit log, refused outright in
KVIEW_READONLY=truemode. The MCP tool additionally carries the sameconfirm=trueguard as topic delete (replaying duplicates messages — the AI is told todryRunfirst).Surfaces
kview replay <sourceTopic> --to-topic T [--to-cluster ID] [--limit N] [--dry-run] [--no-headers].kview_replay_messages— 19 tools now.Bonus fix
MessageBrowserService.browsenever stopped early when the topic was smaller than the limit — it polled until the deadline (up to 60s). It now stops as soon as every assigned partition reaches its end offset; small topics answer immediately, andreachedEndis exact. (The browser test suite dropped from 34s to 15s.)Verification
retry=3and original timestamp preserved, all keys present), dry-run selects 4 poison messages without producing then the real filtered run copies exactly those, cross-connection replay through a second stored profile read back via that connection's own handle.confirm=true).