Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpk topic consume: expand the offset flag #4091

Merged
merged 1 commit into from
Mar 25, 2022
Merged

rpk topic consume: expand the offset flag #4091

merged 1 commit into from
Mar 25, 2022

Conversation

twmb
Copy link
Contributor

@twmb twmb commented Mar 23, 2022

We now:

  • can consume through the end and quit
  • can consume based on time
  • have many options for representing time ranges and durations

Previously, consuming to an end offset left the client running in the
paranoid case that a new partition could be discovered and consumed to
that end offset. Now, we take a snapshot of the end offsets when rpk
starts, consume to those, and quit.

Closes #4073.

Release notes

Improvements

  • Improves rpk topic consume -o, allowing consuming by time, and allows consuming to exit when the ends of partitions are reached.

@twmb twmb requested review from 0x5d and LenaAn as code owners March 23, 2022 20:48
@twmb twmb removed the request for review from LenaAn March 23, 2022 20:49
Copy link
Contributor

@0x5d 0x5d left a comment

Choose a reason for hiding this comment

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

I left minor requests. I went through the parsing code but it's very dense, so I trust the tests cover it sufficiently 🙏🏽

src/go/rpk/pkg/cli/cmd/topic/consume.go Show resolved Hide resolved
src/go/rpk/pkg/cli/cmd/topic/consume.go Show resolved Hide resolved
src/go/rpk/pkg/cli/cmd/topic/consume.go Show resolved Hide resolved
src/go/rpk/pkg/cli/cmd/topic/consume_test.go Outdated Show resolved Hide resolved
src/go/rpk/pkg/cli/cmd/topic/consume_test.go Show resolved Hide resolved
We now:

- can consume through the end and quit
- can consume based on time
- have many options for representing time ranges and durations

Previously, consuming to an end offset left the client running in the
paranoid case that a new partition could be discovered and consumed to
that end offset. Now, we take a snapshot of the end offsets when rpk
starts, consume to those, and quit.

Closes #4073.
@twmb twmb merged commit c2a39fd into redpanda-data:dev Mar 25, 2022
@twmb twmb deleted the consume_offset branch March 25, 2022 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rpk: make it possible to consume messages using timestamps
2 participants