chia7712 commented on code in PR #17080:
URL: https://github.com/apache/kafka/pull/17080#discussion_r1759637125


##########
clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:
##########
@@ -4143,19 +4144,26 @@ public RemoveMembersFromConsumerGroupResult 
removeMembersFromConsumerGroup(Strin
         String reason = options.reason() == null || options.reason().isEmpty() 
?
             DEFAULT_LEAVE_GROUP_REASON : 
JoinGroupRequest.maybeTruncateReason(options.reason());
 
-        List<MemberIdentity> members;
-        if (options.removeAll()) {
-            members = getMembersFromGroup(groupId, reason);
-        } else {
-            members = options.members().stream()
-                .map(m -> m.toMemberIdentity().setReason(reason))
-                .collect(Collectors.toList());
+        final SimpleAdminApiFuture<CoordinatorKey, Map<MemberIdentity, 
Errors>> future =
+                RemoveMembersFromConsumerGroupHandler.newFuture(groupId);
+        if (!options.removeAll()) {

Review Comment:
   Could you please try to reduce duplicate code?



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