fix(DOC-1940): clarify rpk topic consume keeps connection open#1612
fix(DOC-1940): clarify rpk topic consume keeps connection open#1612
Conversation
Add a note explaining that rpk topic consume runs indefinitely by default, waiting for new records. Documents how to exit: Ctrl+C, --num, or an end offset with --offset. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
✅ Deploy Preview for redpanda-docs-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
📝 WalkthroughWalkthroughThis pull request adds documentation to the rpk topic consume command page, clarifying its default behavior. The changes explain that the command maintains a persistent connection and waits indefinitely for new records unless interrupted or controlled by the Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@modules/reference/pages/rpk/rpk-topic/rpk-topic-consume.adoc`:
- Around line 10-14: The doc text for rpk topic consume should clarify the range
offset pattern and either replace or augment `-o start:end` with explicit,
documented examples and a note about `end`'s meaning in ranges: update the
sentence referencing `--offset`/`-o` to show a clear example like `-o :end`
(consume until current end) and/or `-o `@-1m`:end` (consume from one minute ago to
current end), and add a short parenthetical explaining that `end` inside a range
denotes the current end offset (different from using `end` alone); edit the
offset table and examples section to include this explicit `:end`/`@-1m:end`
pattern and the clarifying note so readers aren’t confused by the standalone
`end` meaning.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 47393d7b-97a3-4f2f-9010-2d4e19f43fda
📒 Files selected for processing (1)
modules/reference/pages/rpk/rpk-topic/rpk-topic-consume.adoc
| By default, `rpk topic consume` opens a persistent connection and waits | ||
| indefinitely for new records to arrive. It does not exit after consuming | ||
| existing records. To stop consuming, press `Ctrl+C`, or use `--num` to exit | ||
| after a fixed number of records, or specify an end offset with `--offset` | ||
| (for example, `-o start:end`). |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Search for offset examples using start:end pattern
rg -n "start:end" --type=adoc
# Search for other offset range examples without timestamps
rg -n "\\-o\s+(start|end|:[^@]|\d+:)" --type=adoc -A2 -B2Repository: redpanda-data/docs
Length of output: 119
🏁 Script executed:
#!/bin/bash
# Search for start:end pattern without type filter
rg "start:end" --glob="*.adoc"
# Also search for offset examples in AsciiDoc files
rg "\-o\s+" --glob="*.adoc" -A2 -B2 | head -100Repository: redpanda-data/docs
Length of output: 6857
🏁 Script executed:
#!/bin/bash
# Read the specific file to check offset documentation
wc -l modules/reference/pages/rpk/rpk-topic/rpk-topic-consume.adoc
# Read the offset table section mentioned (lines 120-137)
sed -n '120,137p' modules/reference/pages/rpk/rpk-topic/rpk-topic-consume.adoc
# Read the examples section (lines 173-178)
sed -n '173,180p' modules/reference/pages/rpk/rpk-topic/rpk-topic-consume.adocRepository: redpanda-data/docs
Length of output: 949
Consider using more explicit documented examples for the offset specification.
The example -o start:end is not explicitly documented in the offset table (lines 120-137) or examples section (lines 173-178). While end can be used as an ending offset in ranges (as shown by -o @-1m:end in the examples), the specific pattern start:end doesn't appear elsewhere in the documentation and lacks clear definition.
Use more explicit, documented alternatives such as -o :end (line 126: "Consume until the current end") or model after existing examples like -o @-1m:end. This improves clarity since the offset table shows end as a standalone type meaning "Consume from the end," which could confuse readers about its different meaning when used in range syntax.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@modules/reference/pages/rpk/rpk-topic/rpk-topic-consume.adoc` around lines 10
- 14, The doc text for rpk topic consume should clarify the range offset pattern
and either replace or augment `-o start:end` with explicit, documented examples
and a note about `end`'s meaning in ranges: update the sentence referencing
`--offset`/`-o` to show a clear example like `-o :end` (consume until current
end) and/or `-o `@-1m`:end` (consume from one minute ago to current end), and add
a short parenthetical explaining that `end` inside a range denotes the current
end offset (different from using `end` alone); edit the offset table and
examples section to include this explicit `:end`/`@-1m:end` pattern and the
clarifying note so readers aren’t confused by the standalone `end` meaning.
| indefinitely for new records to arrive. It does not exit after consuming | ||
| existing records. To stop consuming, press `Ctrl+C`, or use `--num` to exit | ||
| after a fixed number of records, or specify an end offset with `--offset` | ||
| (for example, `-o start:end`). |
There was a problem hiding this comment.
-o start:end
-o :end is enough.
Summary
rpk topic consumeclarifying that the command opens a persistent connection and waits indefinitely for new records by defaultCtrl+C,--num, or an end offset with--offsetResolves DOC-1940.
Test plan
🤖 Generated with Claude Code