lianetm commented on code in PR #14390:
URL: https://github.com/apache/kafka/pull/14390#discussion_r1355058608


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/DefaultBackgroundThread.java:
##########
@@ -178,31 +176,34 @@ public DefaultBackgroundThread(final Time time,
                 config);
             HeartbeatRequestManager heartbeatRequestManager = null;
 
-            // TODO: consolidate groupState and memberState
-            if (groupState.groupId != null) {
+            String groupId = config.getString(ConsumerConfig.GROUP_ID_CONFIG);
+            if (groupId != null) {
+                membershipManager = Optional.of(new 
MembershipManagerImpl(groupId));
                 coordinatorRequestManager = new CoordinatorRequestManager(
-                        this.time,
-                        logContext,
-                        retryBackoffMs,
-                        retryBackoffMaxMs,
-                        this.errorEventHandler,
-                        groupState.groupId);
+                    this.time,
+                    logContext,
+                    retryBackoffMs,
+                    retryBackoffMaxMs,
+                    this.errorEventHandler,
+                    membershipManager.get().groupId());
                 commitRequestManager = new CommitRequestManager(
-                        this.time,
-                        logContext,
-                        subscriptionState,
-                        config,
-                        coordinatorRequestManager,
-                        groupState);
-                MembershipManager membershipManager = new 
MembershipManagerImpl(groupState.groupId);
+                    this.time,
+                    logContext,
+                    subscriptionState,
+                    config,
+                    coordinatorRequestManager,
+                    membershipManager.get());
+                MembershipManager membershipManager = new 
MembershipManagerImpl(groupId);

Review Comment:
   This is redundant here, already created above.



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to