kirktrue commented on code in PR #14640:
URL: https://github.com/apache/kafka/pull/14640#discussion_r1423135362


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:
##########
@@ -177,34 +202,37 @@ public void process(final BackgroundEvent event) {
                 case ERROR:
                     process((ErrorBackgroundEvent) event);
                     break;
+
                 case GROUP_METADATA_UPDATE:
                     process((GroupMetadataUpdateEvent) event);
                     break;
+
+                case CONSUMER_REBALANCE_LISTENER_CALLBACK_NEEDED:
+                    process((ConsumerRebalanceListenerCallbackNeededEvent) 
event);
+                    break;
+
                 default:
                     throw new IllegalArgumentException("Background event type 
" + event.type() + " was not expected");
 
             }
         }
 
-        @Override
-        protected Class<BackgroundEvent> getEventClass() {
-            return BackgroundEvent.class;
-        }
-
         private void process(final ErrorBackgroundEvent event) {
             throw event.error();
         }
 
         private void process(final GroupMetadataUpdateEvent event) {
-            if (AsyncKafkaConsumer.this.groupMetadata.isPresent()) {
-                final ConsumerGroupMetadata currentGroupMetadata = 
AsyncKafkaConsumer.this.groupMetadata.get();
-                AsyncKafkaConsumer.this.groupMetadata = Optional.of(new 
ConsumerGroupMetadata(
-                    currentGroupMetadata.groupId(),
-                    event.memberEpoch(),
-                    event.memberId(),
-                    currentGroupMetadata.groupInstanceId()
-                ));
-            }
+            updateConsumerGroupMetadata(event.memberId(), event.memberEpoch());

Review Comment:
   Yes, done.



-- 
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]

Reply via email to