From e434dfad0ec320df426885d36342898e1ee42bf8 Mon Sep 17 00:00:00 2001 From: Jork Zijlstra Date: Fri, 28 Jan 2022 16:39:06 +0100 Subject: [PATCH] skip topic when a TopicAuthorizationException occurs --- .../service/KafkaHighLevelAdminClient.java | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/src/main/java/kafdrop/service/KafkaHighLevelAdminClient.java b/src/main/java/kafdrop/service/KafkaHighLevelAdminClient.java index 26508ae7..e14582f6 100644 --- a/src/main/java/kafdrop/service/KafkaHighLevelAdminClient.java +++ b/src/main/java/kafdrop/service/KafkaHighLevelAdminClient.java @@ -109,7 +109,7 @@ Map describeTopicConfigs(Set topicNames) { if (e.getCause() instanceof UnsupportedVersionException) { return Map.of(); } else if (e.getCause() instanceof TopicAuthorizationException) { - printAcls(); + return Map.of(); } throw new KafkaAdminClientException(e); } @@ -166,17 +166,4 @@ Collection listAcls() { } return aclsBindings; } - - private void printAcls() { - try { - final var acls = adminClient.describeAcls(new AclBindingFilter(ResourcePatternFilter.ANY, AccessControlEntryFilter.ANY)).values().get(); - final var newlineDelimitedAcls = new StringBuilder(); - for (var acl : acls) { - newlineDelimitedAcls.append('\n').append(acl); - } - LOG.info("ACLs: {}", newlineDelimitedAcls); - } catch (InterruptedException | ExecutionException e) { - LOG.error("Error describing ACLs", e); - } - } }