Skip to content

Commit

Permalink
skip topic when a TopicAuthorizationException occurs
Browse files Browse the repository at this point in the history
  • Loading branch information
Jork Zijlstra committed Jan 28, 2022
1 parent e586fda commit e434dfa
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/main/java/kafdrop/service/KafkaHighLevelAdminClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ Map<String, Config> describeTopicConfigs(Set<String> topicNames) {
if (e.getCause() instanceof UnsupportedVersionException) {
return Map.of();
} else if (e.getCause() instanceof TopicAuthorizationException) {
printAcls();
return Map.of();
}
throw new KafkaAdminClientException(e);
}
Expand Down Expand Up @@ -166,17 +166,4 @@ Collection<AclBinding> 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);
}
}
}

0 comments on commit e434dfa

Please sign in to comment.