jeffkbkim commented on code in PR #13870:
URL: https://github.com/apache/kafka/pull/13870#discussion_r1253477738


##########
group-coordinator/src/main/java/org/apache/kafka/coordinator/group/GroupCoordinatorService.java:
##########
@@ -266,9 +295,21 @@ public CompletableFuture<JoinGroupResponseData> joinGroup(
             return 
FutureUtils.failedFuture(Errors.COORDINATOR_NOT_AVAILABLE.exception());
         }
 
-        return FutureUtils.failedFuture(Errors.UNSUPPORTED_VERSION.exception(
-            "This API is not implemented yet."
-        ));
+        CompletableFuture<JoinGroupResponseData> responseFuture = new 
CompletableFuture<>();
+
+        if (!isValidGroupId(request.groupId(), 
ApiKeys.forId(request.apiKey()))) {
+            responseFuture.complete(new JoinGroupResponseData()
+                .setMemberId(request.memberId())
+                .setErrorCode(Errors.INVALID_GROUP_ID.code()));
+
+            return responseFuture;
+        }
+
+        runtime.scheduleGenericGroupOperation("generic-group-join",
+            topicPartitionFor(request.groupId()),
+            coordinator -> coordinator.genericGroupJoin(context, request, 
responseFuture));
+
+        return responseFuture;

Review Comment:
   i don't think this is the right place; we need to add the logic inside group 
metadata manager. i have done so in the sync PR.
   
   the reason is that for generic group apis, the append future is what we want 
the logic for when handling log append/commit errors.
   
   whereas for the new protocol, the consumer group heartbeat waits to return 
the results from the append/commit.
   
   



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