Skip to content

fix(DOC-1940): clarify rpk topic consume keeps connection open#1612

Open
mfernest wants to merge 1 commit intomainfrom
fix/doc-1940-rpk-topic-consume-connection
Open

fix(DOC-1940): clarify rpk topic consume keeps connection open#1612
mfernest wants to merge 1 commit intomainfrom
fix/doc-1940-rpk-topic-consume-connection

Conversation

@mfernest
Copy link
Contributor

@mfernest mfernest commented Mar 17, 2026

Summary

  • Adds a note to rpk topic consume clarifying that the command opens a persistent connection and waits indefinitely for new records by default
  • Documents how to stop consuming: Ctrl+C, --num, or an end offset with --offset

Resolves DOC-1940.

Test plan

  • Deploy preview renders correctly
  • Note appears immediately after the opening description

🤖 Generated with Claude Code

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>
@mfernest mfernest requested a review from a team as a code owner March 17, 2026 19:00
@netlify
Copy link

netlify bot commented Mar 17, 2026

Deploy Preview for redpanda-docs-preview ready!

Name Link
🔨 Latest commit 1128095
🔍 Latest deploy log https://app.netlify.com/projects/redpanda-docs-preview/deploys/69b9a4e6fa224c00086b7dc3
😎 Deploy Preview https://deploy-preview-1612--redpanda-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 17, 2026

📝 Walkthrough

Walkthrough

This 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 --num or --offset options. The documentation also specifies the stopping conditions and includes an example demonstrating the --offset option usage.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main change: clarifying that rpk topic consume keeps a persistent connection open.
Description check ✅ Passed The description covers the key changes and includes the required JIRA ticket reference, but omits required sections like Page previews and Checks from the template.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/doc-1940-rpk-topic-consume-connection
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between fe8a357 and 1128095.

📒 Files selected for processing (1)
  • modules/reference/pages/rpk/rpk-topic/rpk-topic-consume.adoc

Comment on lines +10 to +14
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`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 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 -B2

Repository: 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 -100

Repository: 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.adoc

Repository: 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.

@mfernest mfernest requested a review from daisukebe March 18, 2026 17:11
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`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-o start:end

-o :end is enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants