diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/event/AbstractRefreshListener.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/event/AbstractRefreshListener.java index b73bac01..051a61f8 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/event/AbstractRefreshListener.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/event/AbstractRefreshListener.java @@ -95,10 +95,10 @@ public abstract class AbstractRefreshListener implements RefreshListener i.check(ipSegment, port)); + .distinct() + .map(IpAndPort::build) + .filter(Objects::nonNull) + .anyMatch(i -> i.check(ipSegment, port)); } /** diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/event/AdapterExecutorsRefreshListener.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/event/AdapterExecutorsRefreshListener.java index b7108f6d..09838838 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/event/AdapterExecutorsRefreshListener.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/event/AdapterExecutorsRefreshListener.java @@ -61,7 +61,7 @@ public class AdapterExecutorsRefreshListener extends AbstractRefreshListener { if (Objects.equals(val.mark(), each.getMark())) { val.updateThreadPool(BeanUtil.toBean(each, ThreadPoolAdapterParameter.class)); diff --git a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/event/DynamicThreadPoolRefreshListener.java b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/event/DynamicThreadPoolRefreshListener.java index 915c4225..ec93577c 100644 --- a/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/event/DynamicThreadPoolRefreshListener.java +++ b/hippo4j-spring-boot/hippo4j-config-spring-boot-starter/src/main/java/cn/hippo4j/config/springboot/starter/refresher/event/DynamicThreadPoolRefreshListener.java @@ -79,13 +79,16 @@ public class DynamicThreadPoolRefreshListener extends AbstractRefreshListener executors = bindableConfigProperties.getExecutors(); for (ExecutorProperties properties : executors) { String threadPoolId = properties.getThreadPoolId(); - if (!match(properties) || !checkConsistency(threadPoolId, properties)) { + if (!match(properties)) { continue; } /* * Check whether the notification configuration is consistent, this operation will not trigger the notification. */ checkNotifyConsistencyAndReplace(properties); + if (!checkConsistency(threadPoolId, properties)) { + continue; + } dynamicRefreshPool(threadPoolId, properties); ExecutorProperties beforeProperties = GlobalCoreThreadPoolManage.getProperties(properties.getThreadPoolId()); GlobalCoreThreadPoolManage.refresh(threadPoolId, failDefaultExecutorProperties(beforeProperties, properties));