philipnee commented on code in PR #13021:
URL: https://github.com/apache/kafka/pull/13021#discussion_r1053661970


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/DefaultBackgroundThread.java:
##########
@@ -111,21 +120,36 @@ public DefaultBackgroundThread(final Time time,
                     networkClient);
             this.running = true;
             this.errorEventHandler = new 
ErrorEventHandler(this.backgroundEventQueue);
-            String groupId = rebalanceConfig.groupId;
-            this.coordinatorManager = groupId == null ?
-                    Optional.empty() :
-                    Optional.of(new CoordinatorRequestManager(
-                            logContext,
-                            config,
-                            errorEventHandler,
-                            groupId));
-            this.applicationEventProcessor = new 
ApplicationEventProcessor(backgroundEventQueue);
+            this.groupState = new GroupStateManager(rebalanceConfig);
+            this.requestManagerRegistry = 
Collections.unmodifiableMap(buildRequestManagerRegistry(logContext));
+            this.applicationEventProcessor = new 
ApplicationEventProcessor(backgroundEventQueue, requestManagerRegistry);
         } catch (final Exception e) {
             close();
             throw new KafkaException("Failed to construct background 
processor", e.getCause());
         }
     }
 
+    private Map<RequestManager.Type, Optional<RequestManager>> 
buildRequestManagerRegistry(final LogContext logContext) {

Review Comment:
   Not sure if it is worth writing a builder.



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