diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/io/dynamic/threadpool/starter/core/ThreadPoolConfigAdapter.java b/dynamic-threadpool-spring-boot-starter/src/main/java/io/dynamic/threadpool/starter/core/ThreadPoolConfigAdapter.java index 1c88233c..559dd2fa 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/io/dynamic/threadpool/starter/core/ThreadPoolConfigAdapter.java +++ b/dynamic-threadpool-spring-boot-starter/src/main/java/io/dynamic/threadpool/starter/core/ThreadPoolConfigAdapter.java @@ -5,6 +5,7 @@ import io.dynamic.threadpool.starter.toolkit.thread.QueueTypeEnum; import io.dynamic.threadpool.starter.toolkit.thread.ThreadPoolBuilder; import io.dynamic.threadpool.starter.wrap.DynamicThreadPoolWrap; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; import javax.annotation.PostConstruct; @@ -34,8 +35,8 @@ public class ThreadPoolConfigAdapter extends ConfigAdapter { .rejected(new ThreadPoolExecutor.DiscardOldestPolicy()) .build(); - @Order(1025) @PostConstruct + @Order(Ordered.LOWEST_PRECEDENCE - 2048) public void subscribeConfig() { Map executorMap = ApplicationContextHolder.getBeansOfType(DynamicThreadPoolWrap.class); diff --git a/dynamic-threadpool-spring-boot-starter/src/main/java/io/dynamic/threadpool/starter/listener/ThreadPoolRunListener.java b/dynamic-threadpool-spring-boot-starter/src/main/java/io/dynamic/threadpool/starter/listener/ThreadPoolRunListener.java index a9d7a7df..746fc663 100644 --- a/dynamic-threadpool-spring-boot-starter/src/main/java/io/dynamic/threadpool/starter/listener/ThreadPoolRunListener.java +++ b/dynamic-threadpool-spring-boot-starter/src/main/java/io/dynamic/threadpool/starter/listener/ThreadPoolRunListener.java @@ -16,6 +16,7 @@ import io.dynamic.threadpool.starter.toolkit.thread.RejectedTypeEnum; import io.dynamic.threadpool.starter.toolkit.thread.ThreadPoolBuilder; import io.dynamic.threadpool.starter.wrap.DynamicThreadPoolWrap; import lombok.extern.slf4j.Slf4j; +import org.springframework.core.Ordered; import org.springframework.core.annotation.Order; import javax.annotation.PostConstruct; @@ -40,8 +41,8 @@ public class ThreadPoolRunListener { this.properties = properties; } - @Order(1024) @PostConstruct + @Order(Ordered.LOWEST_PRECEDENCE - 1024) public void run() { DynamicThreadPoolBanner.printBanner(properties.isBanner());