frankvicky commented on code in PR #17080:
URL: https://github.com/apache/kafka/pull/17080#discussion_r1743398593
##########
clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java:
##########
@@ -4114,27 +4114,30 @@ private Integer nodeFor(ConfigResource resource) {
}
}
- private List<MemberIdentity> getMembersFromGroup(String groupId, String
reason) {
- Collection<MemberDescription> members;
- try {
- members =
describeConsumerGroups(Collections.singleton(groupId)).describedGroups().get(groupId).get().members();
- } catch (Exception ex) {
- throw new KafkaException("Encounter exception when trying to get
members from group: " + groupId, ex);
- }
+ private KafkaFutureImpl<List<MemberIdentity>> getMembersFromGroup(String
groupId, String reason) {
+ KafkaFutureImpl<List<MemberIdentity>> future = new KafkaFutureImpl<>();
- List<MemberIdentity> membersToRemove = new ArrayList<>();
- for (final MemberDescription member : members) {
- MemberIdentity memberIdentity = new
MemberIdentity().setReason(reason);
+
describeConsumerGroups(Collections.singleton(groupId)).describedGroups().get(groupId).whenComplete((res,
ex) -> {
+ if (ex != null) {
+ future.completeExceptionally(ex);
+ }
Review Comment:
Do we need to keep executing following logic even if we encounter exception ?
In original one, it seems that the exception will be wrapped as
`KafkaException` and throw.
--
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]