frankvicky commented on code in PR #17549:
URL: https://github.com/apache/kafka/pull/17549#discussion_r1815213715
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -1293,17 +1287,16 @@ public void setInflightCommitStatus(final boolean
inflightCommitStatus) {
}
static class MemberInfo {
- Optional<String> memberId;
+ String memberId = "";
Review Comment:
I reviewed the code and found that in `AsyncKafkaConsumer`, the
`updateGroupMetadata` method uses `memberId` to update
`ConsumerGroupMetadata`[0]. Unfortunately, this method is passed as a lambda to
implement `onMemberEpochUpdated`[1]. As a result, we can't remove the
`memberId` parameter from `onMemberEpochUpdated` since `memberId` cannot be
accessed directly within `AsyncKafkaConsumer`.
The best we could do now is to make sure we only set `MemberInfo.memberId`
once at `membershipManager` constructor.
[0]
https://github.com/apache/kafka/blob/140d35c5459f4c7a91b23a238467cb5aa01b59fb/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java#L635-L646
[1]
https://github.com/apache/kafka/blob/140d35c5459f4c7a91b23a238467cb5aa01b59fb/clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java#L354
It's pass as lambda to L159:
https://github.com/apache/kafka/blob/140d35c5459f4c7a91b23a238467cb5aa01b59fb/clients/src/main/java/org/apache/kafka/clients/consumer/internals/RequestManagers.java#L145-L159
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]