diff --git a/api/src/main/java/io/kafbat/ui/controller/BrokersController.java b/api/src/main/java/io/kafbat/ui/controller/BrokersController.java index 78f61f6a1..88f17c489 100644 --- a/api/src/main/java/io/kafbat/ui/controller/BrokersController.java +++ b/api/src/main/java/io/kafbat/ui/controller/BrokersController.java @@ -1,8 +1,6 @@ package io.kafbat.ui.controller; import io.kafbat.ui.api.BrokersApi; -import io.kafbat.ui.config.Config; -import io.kafbat.ui.exception.ClusterNotFoundException; import io.kafbat.ui.mapper.ClusterMapper; import io.kafbat.ui.model.BrokerConfigDTO; import io.kafbat.ui.model.BrokerConfigItemDTO; @@ -32,7 +30,6 @@ public class BrokersController extends AbstractController implements BrokersApi private final BrokerService brokerService; private final ClusterMapper clusterMapper; - private final Config config; @Override public Mono>> getBrokers(String clusterName, @@ -97,14 +94,10 @@ public Mono>> getBrokerConfig(String cluste .operationParams(Map.of(BROKER_ID, id)) .build(); - Flux brokerConfigs = brokerService.getBrokerConfig(getCluster(clusterName), id) + var kafkaCluster = getCluster(clusterName); + Flux brokerConfigs = brokerService.getBrokerConfig(kafkaCluster, id) .map(clusterMapper::toBrokerConfig); - var kafkaCluster = clustersStorage.getClusterByName(clusterName) - .orElseThrow( - () -> new ClusterNotFoundException( - String.format("No cluster for name '%s'", clusterName))); - if (kafkaCluster.isReadOnly()) { brokerConfigs = brokerConfigs.map(config -> { config.setIsReadOnly(true);