diff --git a/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/CacheData.java b/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/CacheData.java index 5e37e81f..cf4ae1fd 100644 --- a/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/CacheData.java +++ b/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/CacheData.java @@ -70,11 +70,14 @@ public class CacheData { Runnable runnable = () -> { wrap.setLastCallMd5(md5); - listener.receiveConfigInfo(content); }; - listener.getExecutor().execute(runnable); + try { + listener.getExecutor().execute(runnable); + } catch (Exception ex) { + log.error("Failed to execute listener. message :: {}", ex.getMessage()); + } } public void setContent(String content) { diff --git a/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/DynamicThreadPoolPostProcessor.java b/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/DynamicThreadPoolPostProcessor.java index 8fe599a8..50116275 100644 --- a/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/DynamicThreadPoolPostProcessor.java +++ b/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/starter/core/DynamicThreadPoolPostProcessor.java @@ -52,10 +52,10 @@ public final class DynamicThreadPoolPostProcessor implements BeanPostProcessor { .keepAliveTime(2000) .timeUnit(TimeUnit.MILLISECONDS) .workQueue(QueueTypeEnum.ARRAY_BLOCKING_QUEUE) - .capacity(1) + .capacity(1024) .allowCoreThreadTimeOut(true) - .threadFactory("dynamic-threadPool-init-config") - .rejected(new ThreadPoolExecutor.DiscardOldestPolicy()) + .threadFactory("dynamic-threadPool-change-config") + .rejected(new ThreadPoolExecutor.AbortPolicy()) .build(); @Override @@ -84,10 +84,8 @@ public final class DynamicThreadPoolPostProcessor implements BeanPostProcessor { * @param dynamicThreadPoolWrap */ protected void registerAndSubscribe(DynamicThreadPoolWrapper dynamicThreadPoolWrap) { - executorService.execute(() -> { - fillPoolAndRegister(dynamicThreadPoolWrap); - subscribeConfig(dynamicThreadPoolWrap); - }); + fillPoolAndRegister(dynamicThreadPoolWrap); + subscribeConfig(dynamicThreadPoolWrap); } /**