mimaison commented on code in PR #15558:
URL: https://github.com/apache/kafka/pull/15558#discussion_r1540866456


##########
connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorUtils.java:
##########
@@ -320,4 +322,19 @@ static void createCompactedTopic(String topicName, short 
partitions, short repli
     static void createSinglePartitionCompactedTopic(String topicName, short 
replicationFactor, Admin admin) {
         createCompactedTopic(topicName, (short) 1, replicationFactor, admin);
     }
+
+    static <T> T adminCall(Callable<T> callable, Supplier<String> errMsg)
+            throws ExecutionException, InterruptedException {
+        try {
+            return callable.call();
+        } catch (ExecutionException | InterruptedException e) {
+            if (e.getCause() instanceof TopicAuthorizationException ||

Review Comment:
   I think we also need to handle `GroupAuthorizationException` as this can be 
thrown by `listConsumerGroupOffsets()`



##########
connect/mirror/src/main/java/org/apache/kafka/connect/mirror/MirrorCheckpointConnector.java:
##########
@@ -216,7 +217,10 @@ Set<String> findConsumerGroups()
 
     Collection<ConsumerGroupListing> listConsumerGroups()
             throws InterruptedException, ExecutionException {
-        return sourceAdminClient.listConsumerGroups().valid().get();
+        return adminCall(
+                () -> sourceAdminClient.listConsumerGroups().valid().get(),
+                () -> "list consumer groups on cluster " + 
config.sourceClusterAlias()

Review Comment:
   Should we put the alias before `cluster`? so we get a message like `list 
consumer groups on source cluster` for example. I think it reads better than 
`list consumer groups on cluster source`



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