diff --git a/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/api/versionone/gateway/GatewayServiceDiscoveryController.java b/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/api/versionone/gateway/GatewayServiceDiscoveryController.java index 699b30f0..0d4e899b 100644 --- a/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/api/versionone/gateway/GatewayServiceDiscoveryController.java +++ b/kafka-manager-web/src/main/java/com/xiaojukeji/kafka/manager/web/api/versionone/gateway/GatewayServiceDiscoveryController.java @@ -60,6 +60,9 @@ public class GatewayServiceDiscoveryController { if (ValidateUtils.isNull(config) || ValidateUtils.isNull(config.getClusterIdBootstrapServersMap())) { return Result.buildFailure("call init kafka bootstrap servers failed"); } + if (ValidateUtils.isEmptyMap(config.getClusterIdBootstrapServersMap())) { + return Result.buildSuc(); + } return Result.buildSuc(JSON.toJSONString(config.getClusterIdBootstrapServersMap())); } @@ -73,7 +76,9 @@ public class GatewayServiceDiscoveryController { if (ValidateUtils.isNull(config) || ValidateUtils.isNull(config.getClusterIdBootstrapServersMap())) { return Result.buildFailure("call update kafka bootstrap servers failed"); } - + if (ValidateUtils.isEmptyMap(config.getClusterIdBootstrapServersMap())) { + return Result.buildSuc(); + } return Result.buildSuc(JSON.toJSONString(new GatewayConfigVO( String.valueOf(config.getVersion()), JSON.toJSONString(config.getClusterIdBootstrapServersMap()) @@ -89,7 +94,9 @@ public class GatewayServiceDiscoveryController { if (ValidateUtils.isNull(config)) { return Result.buildFailure("call get request queue size config failed"); } - + if (ValidateUtils.isNull(config.getMaxRequestQueueSize())) { + return Result.buildSuc(); + } return Result.buildSuc(JSON.toJSONString( new GatewayConfigVO( String.valueOf(config.getVersion()), @@ -107,7 +114,9 @@ public class GatewayServiceDiscoveryController { if (ValidateUtils.isNull(config)) { return Result.buildFailure("call get app rate config failed"); } - + if (ValidateUtils.isNull(config.getAppRateLimit())) { + return Result.buildSuc(); + } return Result.buildSuc(JSON.toJSONString( new GatewayConfigVO( String.valueOf(config.getVersion()), @@ -125,6 +134,9 @@ public class GatewayServiceDiscoveryController { if (ValidateUtils.isNull(config)) { return Result.buildFailure("call get ip rate config failed"); } + if (ValidateUtils.isNull(config.getIpRateLimit())) { + return Result.buildSuc(); + } return Result.buildSuc(JSON.toJSONString( new GatewayConfigVO( String.valueOf(config.getVersion()), @@ -143,7 +155,9 @@ public class GatewayServiceDiscoveryController { if (ValidateUtils.isNull(config) || ValidateUtils.isNull(config.getSpRateMap())) { return Result.buildFailure("call update kafka bootstrap servers failed"); } - + if (ValidateUtils.isEmptyMap(config.getSpRateMap())) { + return Result.buildSuc(); + } List strList = new ArrayList<>(); for (Map.Entry entry: config.getSpRateMap().entrySet()) { strList.add(entry.getKey() + "#" + String.valueOf(entry.getValue()));