Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure Events Hub support fixed #3540

Merged
merged 4 commits into from
Mar 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -212,17 +212,24 @@ private static Mono<Map<Integer, List<ConfigEntry>>> loadBrokersConfig(AdminClie
.map(brokerId -> new ConfigResource(ConfigResource.Type.BROKER, Integer.toString(brokerId)))
.collect(toList());
return toMono(client.describeConfigs(resources).all())
// some kafka backends (like MSK serverless) do not support broker's configs retrieval,
// in that case InvalidRequestException will be thrown
.onErrorResume(InvalidRequestException.class, th -> {
log.trace("Error while getting broker {} configs", brokerIds, th);
return Mono.just(Map.of());
})
// some kafka backends don't support broker's configs retrieval,
// and throw various exceptions on describeConfigs() call
.onErrorResume(th -> th instanceof InvalidRequestException // MSK Serverless
|| th instanceof UnknownTopicOrPartitionException, // Azure event hub
th -> {
log.trace("Error while getting configs for brokers {}", brokerIds, th);
return Mono.just(Map.of());
})
// there are situations when kafka-ui user has no DESCRIBE_CONFIGS permission on cluster
.onErrorResume(ClusterAuthorizationException.class, th -> {
log.trace("AuthorizationException while getting configs for brokers {}", brokerIds, th);
return Mono.just(Map.of());
})
// catching all remaining exceptions, but logging on WARN level
.onErrorResume(th -> true, th -> {
log.warn("Unexpected error while getting configs for brokers {}", brokerIds, th);
return Mono.just(Map.of());
})
.map(config -> config.entrySet().stream()
.collect(toMap(
c -> Integer.valueOf(c.getKey().name()),
Expand Down