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

A way to retrieve what partitions where consumer is signed #615

Open
romani-felipe opened this issue Mar 9, 2021 · 3 comments · May be fixed by #1305
Open

A way to retrieve what partitions where consumer is signed #615

romani-felipe opened this issue Mar 9, 2021 · 3 comments · May be fixed by #1305
Assignees

Comments

@romani-felipe
Copy link

romani-felipe commented Mar 9, 2021

Hi everyone!

Some way to provide information of what partitions this client is signed.

I think can be a method inside ReaderKafka like this:

r := kafka.ReaderConfig{
		Brokers: []string{"localhost:9092"},
		Topic:   "topic.test",
		GroupID: "test-group",
	}
r.SignedPartitions(func(partitions) {
     fmt.Println(partitions) // partitions parameter is a slice []int{} because a consumer can sign more than one partition
}) 
// It´s can be a closure function hook for when occur a rebalance it can do some action again, print, log ou something else

This is helpful for consumer groups to debug who is assigned to what partition.

The Java client provides this kind of information.

thanks for great job!

@achille-roussel
Copy link
Contributor

Hello @romani-felipe, thanks for opening this issue!

The change you're suggesting sounds interesting, would you be able to submit a pull request implementing the feature?

Happy to discuss implementation details in this issue as well if you have questions about how to go about making the change.

@romani-felipe
Copy link
Author

@achille-roussel Sure!

In next days i will start the implementation and will update this issue.

@achille-roussel
Copy link
Contributor

Hello @romani-felipe!

I wanted to cycle back on this and ask if you still needed this feature, or maybe you had found a workaround?

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

Successfully merging a pull request may close this issue.

2 participants