Skip to content

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

Open
@romani-felipe

Description

@romani-felipe

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!

Activity

achille-roussel

achille-roussel commented on Mar 12, 2021

@achille-roussel
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

romani-felipe commented on Mar 13, 2021

@romani-felipe
Author

@achille-roussel Sure!

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

achille-roussel

achille-roussel commented on Feb 15, 2022

@achille-roussel
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

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Participants

    @achille-roussel@romani-felipe

    Issue actions

      A way to retrieve what partitions where consumer is signed · Issue #615 · segmentio/kafka-go