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

Support creating new consumer groups, and add "earliest" offset #343

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

TyBrown
Copy link

@TyBrown TyBrown commented Jul 10, 2024

In our Kafka clusters we do not allow auto-creation of Consumer Groups, as we want that to be a manual step. Given that, Kaf refuses to create a brand new consumer group because the Kafka API reports it's status as Dead when it doesn't exist at all. This change teaches Kaf how to create consumer group offsets in this situation.

I also added the "earliest" verb to the offset options as an alias to "oldest"... that's the verbiage that the Kafka provided tooling uses, so it's what we are most used to as well. (A nice to have for us... but not strictly necessary for this PR if you'd prefer not to incorporate it.)

(To keep the logic simple, I used slices.Contains(), but the Go version of 1.18 in go.mod doesn't have the stdlib version of slices yet... I'm quite happy to switch that and update to 1.21 or later in the go.mod file, I just wasn't sure if there was a reason you were holding back so I started with the golang.org/x/exp/slices package)

@birdayz
Copy link
Owner

birdayz commented Jul 11, 2024

feel free to bump go to latest. thanks!

@TyBrown
Copy link
Author

TyBrown commented Jul 12, 2024

Awesome, thank you so much! :) I've updated Go to 1.22 in this PR.

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.

None yet

2 participants