aliehsaeedii commented on code in PR #20157:
URL: https://github.com/apache/kafka/pull/20157#discussion_r2204889505


##########
tools/src/main/java/org/apache/kafka/tools/streams/StreamsGroupCommand.java:
##########
@@ -830,8 +831,19 @@ Map<String, List<String>> 
retrieveInternalTopics(List<String> groupIds) {
                 }
             } catch (InterruptedException | ExecutionException e) {
                 if (e.getCause() instanceof UnsupportedVersionException) {
-                    printError("Retrieving internal topics is not supported by 
the broker version. " +
-                        "Use 'kafka-topics.sh' to list and delete the group's 
internal topics.", Optional.of(e.getCause()));
+                    try {
+                        // Retrieve internal topic list if possible, and add 
the list of topic names to error message
+                        Set<String> allTopics = 
adminClient.listTopics().names().get();
+                        List<String> internalTopics = allTopics.stream()
+                            .filter(topic -> 
groupIds.stream().anyMatch(groupId -> isInferredInternalTopic(topic, groupId)))
+                            .collect(Collectors.toList());
+                        printError("Retrieving internal topics is not 
supported by the broker version.\n" +
+                            "Internal Topics: (" + String.join(",", 
internalTopics) + ").\n" +
+                            "Use 'kafka-topics.sh' to list and delete the 
group's internal topics.", Optional.of(e.getCause()));

Review Comment:
   Since the topics are already listed, please remove the `to list` from the 
error message.



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