-
Notifications
You must be signed in to change notification settings - Fork 796
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
#615 - allow specifying a listener for partition assignment changes #1305
base: main
Are you sure you want to change the base?
#615 - allow specifying a listener for partition assignment changes #1305
Conversation
@achille-roussel I saw you commented on #615 . Is this something you could review? |
I don't think adding this is a good idea. Instead, you should probably use the ConsumerGroup API to listen for a new generation and construct a new reader. |
Thanks for the feedback @isaacd9 ! Could you elaborate? I had a quick look at the NewReader. Also it seems to use Maybe, instead, a modification safe version of ConsumerGroup should be exposed (that only has Next but not Close) in the Something like:
|
@petedannemann , sorry for the direct ping but you seem to have reviewed some of the last PRs. I wonder if this is something you could provide feedback on the approach (or the alternatives provided by Isaac or my counter proposal). |
heya @erikdw / @jkoelker apologies for the direct ping, but this has been laying around for a while and I would need some guidance (as you seem to have approved the last merged PRs) If you're indeed maintainers of this library, are you ok with this approach? Would you prefer the one outlined in #1305 (comment) or a different one? Happy to take on those suggestions |
@nachogiljaldo I suspect this has sat for while as the commit messages and pr description don't give very much context as to why its necessary. I clicked through the issue and after reading the discussion there, I understand that there is a desire to notify other portions of the code when group reassignment takes place. I'm not familiar with this code or kafka implementation details, so as to use a Code wise, I'm not sure sorting the list is necessary and would just delay the re-assignment if a listener doesn't need it sorted, if a listener needs it sorted, I'd assume it would sort it itself. |
35de2e9
to
5e3960d
Compare
@jkoelker thanks for the prompt reply! Fair points, I updated the PR description and first commit message to be more informative, I hope that makes sense. Also removed the sorting as you suggested. As per the specifics of the implementation, since you said you're not familiar with the code or kafka, would you know who could help providing feedback on the approach / review this PR? |
Closes #615
Adds a listener to send re-assignments to a listener. After this, it is possible to possible to provide a listener (optional) to have consumers be notified of changes in partition assignments for the current consumer.
This is useful for debugging as well as potentially other things such as dropping in-flight events for partitions that are not owned anymore.