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 268cd3d7..a42793a5 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 @@ -81,24 +81,26 @@ public abstract class AbstractRefreshListener implements RefreshListener i.check(ipSegment, port)); + .distinct() + .map(IpAndPort::build) + .filter(Objects::nonNull) + .anyMatch(i -> i.check(ipSegment, port)); + } + + /** + * get nodes in new properties + * + * @param properties new properties + * @return nodes in properties + */ + protected String getNodes(M properties) { + return ALL; } /** 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 09838838..63eaf876 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 @@ -42,9 +42,8 @@ import static cn.hippo4j.config.springboot.starter.refresher.event.Hippo4jConfig public class AdapterExecutorsRefreshListener extends AbstractRefreshListener { @Override - public boolean match(AdapterExecutorProperties properties) { - String nodes = properties.getNodes(); - return checkArray(nodes); + public String getNodes(AdapterExecutorProperties properties) { + return properties.getNodes(); } @Override @@ -61,7 +60,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 ec93577c..1bf61464 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 @@ -21,6 +21,7 @@ import cn.hippo4j.common.executor.support.BlockingQueueTypeEnum; import cn.hippo4j.common.executor.support.RejectedPolicyTypeEnum; import cn.hippo4j.common.executor.support.ResizableCapacityLinkedBlockingQueue; import cn.hippo4j.common.toolkit.CollectionUtil; +import cn.hippo4j.config.springboot.starter.config.AdapterExecutorProperties; import cn.hippo4j.config.springboot.starter.config.BootstrapConfigProperties; import cn.hippo4j.config.springboot.starter.config.ExecutorProperties; import cn.hippo4j.config.springboot.starter.notify.CoreNotifyConfigBuilder; @@ -68,9 +69,8 @@ public class DynamicThreadPoolRefreshListener extends AbstractRefreshListener { @Override - public boolean match(WebThreadPoolProperties properties) { - String nodes = properties.getNodes(); - return checkArray(nodes); + public String getNodes(WebThreadPoolProperties properties) { + return properties.getNodes(); } @Override