From b260c67ca7c457c37bb78c5065c850c7f80dae37 Mon Sep 17 00:00:00 2001 From: "chen.ma" Date: Wed, 22 Jun 2022 21:29:00 +0800 Subject: [PATCH 1/5] Fix Apollo configuration change delay (#267) --- .../common/api/ThreadPoolDynamicRefresh.java | 11 +++++++++ .../AbstractCoreThreadPoolDynamicRefresh.java | 9 ++++++++ .../refresher/ApolloRefresherHandler.java | 23 ++++++++++++++----- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/hippo4j-common/src/main/java/cn/hippo4j/common/api/ThreadPoolDynamicRefresh.java b/hippo4j-common/src/main/java/cn/hippo4j/common/api/ThreadPoolDynamicRefresh.java index 57518b56..2221044c 100644 --- a/hippo4j-common/src/main/java/cn/hippo4j/common/api/ThreadPoolDynamicRefresh.java +++ b/hippo4j-common/src/main/java/cn/hippo4j/common/api/ThreadPoolDynamicRefresh.java @@ -17,6 +17,8 @@ package cn.hippo4j.common.api; +import java.util.Map; + /** * Thread-pool dynamic refresh. */ @@ -28,4 +30,13 @@ public interface ThreadPoolDynamicRefresh { * @param content */ void dynamicRefresh(String content); + + /** + * Dynamic refresh. + * + * @param content + * @param newValueChangeMap + */ + default void dynamicRefresh(String content, Map newValueChangeMap) { + } } diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/AbstractCoreThreadPoolDynamicRefresh.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/AbstractCoreThreadPoolDynamicRefresh.java index dfa0cf37..969fc92e 100644 --- a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/AbstractCoreThreadPoolDynamicRefresh.java +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/AbstractCoreThreadPoolDynamicRefresh.java @@ -19,6 +19,7 @@ package cn.hippo4j.core.springboot.starter.refresher; import cn.hippo4j.common.api.ThreadPoolDynamicRefresh; import cn.hippo4j.common.config.ApplicationContextHolder; +import cn.hippo4j.common.toolkit.CollectionUtil; import cn.hippo4j.core.executor.support.ThreadPoolBuilder; import cn.hippo4j.core.springboot.starter.config.BootstrapCoreProperties; import cn.hippo4j.core.springboot.starter.parser.ConfigParserHandler; @@ -28,6 +29,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.InitializingBean; import java.util.Map; +import java.util.Optional; import java.util.concurrent.ExecutorService; /** @@ -50,8 +52,15 @@ public abstract class AbstractCoreThreadPoolDynamicRefresh implements ThreadPool @Override public void dynamicRefresh(String configContent) { + dynamicRefresh(configContent, null); + } + + public void dynamicRefresh(String configContent, Map newValueChangeMap) { try { Map configInfo = ConfigParserHandler.getInstance().parseConfig(configContent, bootstrapCoreProperties.getConfigFileType()); + if (CollectionUtil.isNotEmpty(newValueChangeMap)) { + Optional.ofNullable(configInfo).ifPresent(each -> each.putAll(newValueChangeMap)); + } BootstrapCoreProperties bindableCoreProperties = BootstrapCorePropertiesBinderAdapt.bootstrapCorePropertiesBinder(configInfo, bootstrapCoreProperties); ApplicationContextHolder.getInstance().publishEvent(new Hippo4jCoreDynamicRefreshEvent(this, bindableCoreProperties)); } catch (Exception ex) { diff --git a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/ApolloRefresherHandler.java b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/ApolloRefresherHandler.java index 6c7913f6..e9960573 100644 --- a/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/ApolloRefresherHandler.java +++ b/hippo4j-spring-boot/hippo4j-core-spring-boot-starter/src/main/java/cn/hippo4j/core/springboot/starter/refresher/ApolloRefresherHandler.java @@ -22,9 +22,15 @@ import com.ctrip.framework.apollo.ConfigChangeListener; import com.ctrip.framework.apollo.ConfigFile; import com.ctrip.framework.apollo.ConfigService; import com.ctrip.framework.apollo.core.enums.ConfigFileFormat; +import com.ctrip.framework.apollo.model.ConfigChange; +import com.google.common.collect.Maps; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; +import java.util.Map; + +import static cn.hippo4j.core.springboot.starter.config.BootstrapCoreProperties.PREFIX; + /** * @author : wh * @date : 2022/2/28 21:32 @@ -42,13 +48,18 @@ public class ApolloRefresherHandler extends AbstractCoreThreadPoolDynamicRefresh public void afterPropertiesSet() { String[] apolloNamespaces = this.namespace.split(","); this.namespace = apolloNamespaces[0]; - Config config = ConfigService.getConfig(namespace); + Config config = ConfigService.getConfig(String.format("%s.%s", namespace, bootstrapCoreProperties.getConfigFileType().getValue())); ConfigChangeListener configChangeListener = configChangeEvent -> { - ConfigFile configFile = ConfigService.getConfigFile( - this.namespace.replaceAll("." + bootstrapCoreProperties.getConfigFileType().getValue(), ""), - ConfigFileFormat.fromString(bootstrapCoreProperties.getConfigFileType().getValue())); - String configInfo = configFile.getContent(); - dynamicRefresh(configInfo); + String namespace = this.namespace.replaceAll("." + bootstrapCoreProperties.getConfigFileType().getValue(), ""); + ConfigFileFormat configFileFormat = ConfigFileFormat.fromString(bootstrapCoreProperties.getConfigFileType().getValue()); + ConfigFile configFile = ConfigService.getConfigFile(namespace, configFileFormat); + Map newChangeValueMap = Maps.newHashMap(); + configChangeEvent.changedKeys().stream().filter(each -> each.contains(PREFIX)).forEach(each -> { + ConfigChange change = configChangeEvent.getChange(each); + String newValue = change.getNewValue(); + newChangeValueMap.put(each, newValue); + }); + dynamicRefresh(configFile.getContent(), newChangeValueMap); }; config.addChangeListener(configChangeListener); log.info("dynamic-thread-pool refresher, add apollo listener success, namespace: {}", namespace); From 2651fcc2f57421b92044832bc24ce97fb839be67 Mon Sep 17 00:00:00 2001 From: "chen.ma" Date: Wed, 22 Jun 2022 21:30:07 +0800 Subject: [PATCH 2/5] Modify the Apollo version of the Apollo sample project --- .../pom.xml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/pom.xml b/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/pom.xml index 735494e3..b8659033 100644 --- a/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/pom.xml +++ b/hippo4j-example/hippo4j-core-apollo-spring-boot-starter-example/pom.xml @@ -47,7 +47,7 @@ com.ctrip.framework.apollo apollo-client - 1.3.0 + ${apollo.version} @@ -56,6 +56,12 @@ 2.2.5.RELEASE + + org.slf4j + slf4j-api + 1.7.21 + + io.micrometer micrometer-registry-prometheus From 70b91313f5a3bb4eabf5a671732d67c5f0fe279a Mon Sep 17 00:00:00 2001 From: "chen.ma" Date: Thu, 23 Jun 2022 09:04:43 +0800 Subject: [PATCH 3/5] Adapt to higher version Tomcat thread pool (#260) --- hippo4j-core/pom.xml | 10 +- .../state/AbstractThreadPoolRuntime.java | 2 +- .../state/ThreadPoolRunStateHandler.java | 2 +- .../web/TomcatWebThreadPoolHandler.java | 137 ++++++++++++++---- .../web/WebThreadPoolRunStateHandler.java | 2 +- .../monitor/collect/RunTimeInfoCollector.java | 2 +- pom.xml | 1 + 7 files changed, 121 insertions(+), 35 deletions(-) diff --git a/hippo4j-core/pom.xml b/hippo4j-core/pom.xml index ea8fe3be..0427ee24 100644 --- a/hippo4j-core/pom.xml +++ b/hippo4j-core/pom.xml @@ -35,24 +35,28 @@ + + org.apache.tomcat.embed + tomcat-embed-core + ${tomcat-embed-core.version} + true + + org.springframework.boot spring-boot-starter-tomcat - compile true org.springframework.boot spring-boot-starter-jetty - compile true org.springframework.boot spring-boot-starter-undertow - compile true diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/state/AbstractThreadPoolRuntime.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/state/AbstractThreadPoolRuntime.java index e1b5330c..9ad71974 100644 --- a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/state/AbstractThreadPoolRuntime.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/state/AbstractThreadPoolRuntime.java @@ -43,7 +43,7 @@ public abstract class AbstractThreadPoolRuntime { * @param threadPoolRunStateInfo * @return */ - protected abstract ThreadPoolRunStateInfo supplement(ThreadPoolRunStateInfo threadPoolRunStateInfo); + public abstract ThreadPoolRunStateInfo supplement(ThreadPoolRunStateInfo threadPoolRunStateInfo); /** * Get pool run state. diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/state/ThreadPoolRunStateHandler.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/state/ThreadPoolRunStateHandler.java index 5eefb49b..e50f07dd 100644 --- a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/state/ThreadPoolRunStateHandler.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/state/ThreadPoolRunStateHandler.java @@ -51,7 +51,7 @@ public class ThreadPoolRunStateHandler extends AbstractThreadPoolRuntime { private final ConfigurableEnvironment environment; @Override - protected ThreadPoolRunStateInfo supplement(ThreadPoolRunStateInfo poolRunStateInfo) { + public ThreadPoolRunStateInfo supplement(ThreadPoolRunStateInfo poolRunStateInfo) { RuntimeInfo runtimeInfo = new RuntimeInfo(); String memoryProportion = StrUtil.builder( "已分配: ", diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/TomcatWebThreadPoolHandler.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/TomcatWebThreadPoolHandler.java index a002930f..44b766c7 100644 --- a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/TomcatWebThreadPoolHandler.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/TomcatWebThreadPoolHandler.java @@ -22,11 +22,14 @@ import cn.hippo4j.common.model.ThreadPoolParameter; import cn.hippo4j.common.model.ThreadPoolParameterInfo; import cn.hippo4j.common.model.ThreadPoolRunStateInfo; import cn.hippo4j.core.executor.state.AbstractThreadPoolRuntime; +import cn.hippo4j.core.toolkit.CalculateUtil; +import cn.hutool.core.date.DateUtil; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.boot.web.embedded.tomcat.TomcatWebServer; import org.springframework.boot.web.server.WebServer; +import java.util.Date; import java.util.concurrent.*; import java.util.concurrent.atomic.AtomicBoolean; @@ -68,36 +71,58 @@ public class TomcatWebThreadPoolHandler extends AbstractWebThreadPoolService { @Override public ThreadPoolBaseInfo simpleInfo() { ThreadPoolBaseInfo poolBaseInfo = new ThreadPoolBaseInfo(); - ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) executor; - int corePoolSize = threadPoolExecutor.getCorePoolSize(); - int maximumPoolSize = threadPoolExecutor.getMaximumPoolSize(); - RejectedExecutionHandler rejectedExecutionHandler = threadPoolExecutor.getRejectedExecutionHandler(); - long keepAliveTime = threadPoolExecutor.getKeepAliveTime(TimeUnit.SECONDS); - - BlockingQueue queue = threadPoolExecutor.getQueue(); - int queueSize = queue.size(); - int remainingCapacity = queue.remainingCapacity(); - int queueCapacity = queueSize + remainingCapacity; - + int corePoolSize, maximumPoolSize, queueCapacity; + long keepAliveTime; + String rejectedExecutionHandlerName; + BlockingQueue blockingQueue; + if (executor instanceof ThreadPoolExecutor) { + ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) executor; + corePoolSize = threadPoolExecutor.getCorePoolSize(); + maximumPoolSize = threadPoolExecutor.getMaximumPoolSize(); + keepAliveTime = threadPoolExecutor.getKeepAliveTime(TimeUnit.SECONDS); + blockingQueue = threadPoolExecutor.getQueue(); + int queueSize = blockingQueue.size(); + int remainingCapacity = blockingQueue.remainingCapacity(); + queueCapacity = queueSize + remainingCapacity; + RejectedExecutionHandler rejectedExecutionHandler = threadPoolExecutor.getRejectedExecutionHandler(); + rejectedExecutionHandlerName = rejectedExecutionHandler.getClass().getSimpleName(); + } else { + org.apache.tomcat.util.threads.ThreadPoolExecutor tomcatThreadPoolExecutor = (org.apache.tomcat.util.threads.ThreadPoolExecutor) executor; + corePoolSize = tomcatThreadPoolExecutor.getCorePoolSize(); + maximumPoolSize = tomcatThreadPoolExecutor.getMaximumPoolSize(); + keepAliveTime = tomcatThreadPoolExecutor.getKeepAliveTime(TimeUnit.SECONDS); + blockingQueue = tomcatThreadPoolExecutor.getQueue(); + int queueSize = blockingQueue.size(); + int remainingCapacity = blockingQueue.remainingCapacity(); + queueCapacity = queueSize + remainingCapacity; + rejectedExecutionHandlerName = tomcatThreadPoolExecutor.getRejectedExecutionHandler().getClass().getSimpleName(); + } poolBaseInfo.setCoreSize(corePoolSize); poolBaseInfo.setMaximumSize(maximumPoolSize); poolBaseInfo.setKeepAliveTime(keepAliveTime); - poolBaseInfo.setQueueType(queue.getClass().getSimpleName()); + poolBaseInfo.setQueueType(blockingQueue.getClass().getSimpleName()); poolBaseInfo.setQueueCapacity(queueCapacity); - poolBaseInfo.setRejectedName(rejectedExecutionHandler.getClass().getSimpleName()); + poolBaseInfo.setRejectedName(rejectedExecutionHandlerName); return poolBaseInfo; } @Override public ThreadPoolParameter getWebThreadPoolParameter() { - ThreadPoolParameterInfo parameterInfo = null; + ThreadPoolParameterInfo parameterInfo = new ThreadPoolParameterInfo(); + int minThreads, maxThreads; + long keepAliveTime; try { - parameterInfo = new ThreadPoolParameterInfo(); - ThreadPoolExecutor tomcatExecutor = (ThreadPoolExecutor) executor; - int minThreads = tomcatExecutor.getCorePoolSize(); - int maxThreads = tomcatExecutor.getMaximumPoolSize(); - long keepAliveTime = tomcatExecutor.getKeepAliveTime(TimeUnit.SECONDS); - + if (executor instanceof ThreadPoolExecutor) { + ThreadPoolExecutor tomcatExecutor = (ThreadPoolExecutor) executor; + minThreads = tomcatExecutor.getCorePoolSize(); + maxThreads = tomcatExecutor.getMaximumPoolSize(); + keepAliveTime = tomcatExecutor.getKeepAliveTime(TimeUnit.SECONDS); + } else { + org.apache.tomcat.util.threads.ThreadPoolExecutor tomcatThreadPoolExecutor = (org.apache.tomcat.util.threads.ThreadPoolExecutor) executor; + minThreads = tomcatThreadPoolExecutor.getCorePoolSize(); + maxThreads = tomcatThreadPoolExecutor.getMaximumPoolSize(); + keepAliveTime = tomcatThreadPoolExecutor.getKeepAliveTime(TimeUnit.SECONDS); + } parameterInfo.setCoreSize(minThreads); parameterInfo.setMaxSize(maxThreads); parameterInfo.setKeepAliveTime((int) keepAliveTime); @@ -109,19 +134,75 @@ public class TomcatWebThreadPoolHandler extends AbstractWebThreadPoolService { @Override public ThreadPoolRunStateInfo getWebRunStateInfo() { - return webThreadPoolRunStateHandler.getPoolRunState(null, executor); + if (executor instanceof ThreadPoolExecutor) { + return webThreadPoolRunStateHandler.getPoolRunState(null, executor); + } + ThreadPoolRunStateInfo runStateInfo = new ThreadPoolRunStateInfo(); + org.apache.tomcat.util.threads.ThreadPoolExecutor tomcatThreadPoolExecutor = (org.apache.tomcat.util.threads.ThreadPoolExecutor) executor; + // 核心线程数 + int corePoolSize = tomcatThreadPoolExecutor.getCorePoolSize(); + // 最大线程数 + int maximumPoolSize = tomcatThreadPoolExecutor.getMaximumPoolSize(); + // 线程池当前线程数 (有锁) + int poolSize = tomcatThreadPoolExecutor.getPoolSize(); + // 活跃线程数 (有锁) + int activeCount = tomcatThreadPoolExecutor.getActiveCount(); + // 同时进入池中的最大线程数 (有锁) + int largestPoolSize = tomcatThreadPoolExecutor.getLargestPoolSize(); + // 线程池中执行任务总数量 (有锁) + long completedTaskCount = tomcatThreadPoolExecutor.getCompletedTaskCount(); + // 当前负载 + String currentLoad = CalculateUtil.divide(activeCount, maximumPoolSize) + ""; + // 峰值负载 + String peakLoad = CalculateUtil.divide(largestPoolSize, maximumPoolSize) + ""; + BlockingQueue queue = tomcatThreadPoolExecutor.getQueue(); + // 队列元素个数 + int queueSize = queue.size(); + // 队列类型 + String queueType = queue.getClass().getSimpleName(); + // 队列剩余容量 + int remainingCapacity = queue.remainingCapacity(); + // 队列容量 + int queueCapacity = queueSize + remainingCapacity; + runStateInfo.setCoreSize(corePoolSize); + runStateInfo.setPoolSize(poolSize); + runStateInfo.setMaximumSize(maximumPoolSize); + runStateInfo.setActiveSize(activeCount); + runStateInfo.setCurrentLoad(currentLoad); + runStateInfo.setPeakLoad(peakLoad); + runStateInfo.setQueueType(queueType); + runStateInfo.setQueueSize(queueSize); + runStateInfo.setQueueCapacity(queueCapacity); + runStateInfo.setQueueRemainingCapacity(remainingCapacity); + runStateInfo.setLargestPoolSize(largestPoolSize); + runStateInfo.setCompletedTaskCount(completedTaskCount); + runStateInfo.setClientLastRefreshTime(DateUtil.formatDateTime(new Date())); + runStateInfo.setTimestamp(System.currentTimeMillis()); + return webThreadPoolRunStateHandler.supplement(runStateInfo); } @Override public void updateWebThreadPool(ThreadPoolParameterInfo threadPoolParameterInfo) { + int originalCoreSize, originalMaximumPoolSize; + long originalKeepAliveTime; try { - ThreadPoolExecutor tomcatExecutor = (ThreadPoolExecutor) executor; - int originalCoreSize = tomcatExecutor.getCorePoolSize(); - int originalMaximumPoolSize = tomcatExecutor.getMaximumPoolSize(); - long originalKeepAliveTime = tomcatExecutor.getKeepAliveTime(TimeUnit.SECONDS); - tomcatExecutor.setCorePoolSize(threadPoolParameterInfo.corePoolSizeAdapt()); - tomcatExecutor.setMaximumPoolSize(threadPoolParameterInfo.maximumPoolSizeAdapt()); - tomcatExecutor.setKeepAliveTime(threadPoolParameterInfo.getKeepAliveTime(), TimeUnit.SECONDS); + if (executor instanceof ThreadPoolExecutor) { + ThreadPoolExecutor threadPoolExecutor = (ThreadPoolExecutor) executor; + originalCoreSize = threadPoolExecutor.getCorePoolSize(); + originalMaximumPoolSize = threadPoolExecutor.getMaximumPoolSize(); + originalKeepAliveTime = threadPoolExecutor.getKeepAliveTime(TimeUnit.SECONDS); + threadPoolExecutor.setCorePoolSize(threadPoolParameterInfo.corePoolSizeAdapt()); + threadPoolExecutor.setMaximumPoolSize(threadPoolParameterInfo.maximumPoolSizeAdapt()); + threadPoolExecutor.setKeepAliveTime(threadPoolParameterInfo.getKeepAliveTime(), TimeUnit.SECONDS); + } else { + org.apache.tomcat.util.threads.ThreadPoolExecutor tomcatThreadPoolExecutor = (org.apache.tomcat.util.threads.ThreadPoolExecutor) executor; + originalCoreSize = tomcatThreadPoolExecutor.getCorePoolSize(); + originalMaximumPoolSize = tomcatThreadPoolExecutor.getMaximumPoolSize(); + originalKeepAliveTime = tomcatThreadPoolExecutor.getKeepAliveTime(TimeUnit.SECONDS); + tomcatThreadPoolExecutor.setCorePoolSize(threadPoolParameterInfo.corePoolSizeAdapt()); + tomcatThreadPoolExecutor.setMaximumPoolSize(threadPoolParameterInfo.maximumPoolSizeAdapt()); + tomcatThreadPoolExecutor.setKeepAliveTime(threadPoolParameterInfo.getKeepAliveTime(), TimeUnit.SECONDS); + } log.info("[TOMCAT] Changed web thread pool. corePoolSize :: [{}], maximumPoolSize :: [{}], keepAliveTime :: [{}]", String.format(CHANGE_DELIMITER, originalCoreSize, threadPoolParameterInfo.corePoolSizeAdapt()), String.format(CHANGE_DELIMITER, originalMaximumPoolSize, threadPoolParameterInfo.maximumPoolSizeAdapt()), diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/WebThreadPoolRunStateHandler.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/WebThreadPoolRunStateHandler.java index d7ef84b9..3a5c633b 100644 --- a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/WebThreadPoolRunStateHandler.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/web/WebThreadPoolRunStateHandler.java @@ -34,7 +34,7 @@ import lombok.extern.slf4j.Slf4j; public class WebThreadPoolRunStateHandler extends AbstractThreadPoolRuntime { @Override - protected ThreadPoolRunStateInfo supplement(ThreadPoolRunStateInfo poolRunStateInfo) { + public ThreadPoolRunStateInfo supplement(ThreadPoolRunStateInfo poolRunStateInfo) { RuntimeInfo runtimeInfo = new RuntimeInfo(); String memoryProportion = StrUtil.builder( "已分配: ", diff --git a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/springboot/starter/monitor/collect/RunTimeInfoCollector.java b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/springboot/starter/monitor/collect/RunTimeInfoCollector.java index 26446919..d12ad787 100644 --- a/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/springboot/starter/monitor/collect/RunTimeInfoCollector.java +++ b/hippo4j-spring-boot/hippo4j-spring-boot-starter/src/main/java/cn/hippo4j/springboot/starter/monitor/collect/RunTimeInfoCollector.java @@ -61,7 +61,7 @@ public class RunTimeInfoCollector extends AbstractThreadPoolRuntime implements C } @Override - protected ThreadPoolRunStateInfo supplement(ThreadPoolRunStateInfo threadPoolRunStateInfo) { + public ThreadPoolRunStateInfo supplement(ThreadPoolRunStateInfo threadPoolRunStateInfo) { return threadPoolRunStateInfo; } } diff --git a/pom.xml b/pom.xml index a3ba867d..38cd7147 100644 --- a/pom.xml +++ b/pom.xml @@ -48,6 +48,7 @@ 2.3.2.RELEASE 1.9.1 2.2.2 + 9.0.55 2.2.6.RELEASE false From ca0ec6f338ecb3dc83bdd6f6b1f08d08f53064c7 Mon Sep 17 00:00:00 2001 From: "chen.ma" Date: Thu, 23 Jun 2022 09:05:20 +0800 Subject: [PATCH 4/5] Test of adapting to high version Tomcat thread pool (#260) --- hippo4j-example/hippo4j-spring-boot-starter-example/pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hippo4j-example/hippo4j-spring-boot-starter-example/pom.xml b/hippo4j-example/hippo4j-spring-boot-starter-example/pom.xml index 69afc946..ef85459f 100644 --- a/hippo4j-example/hippo4j-spring-boot-starter-example/pom.xml +++ b/hippo4j-example/hippo4j-spring-boot-starter-example/pom.xml @@ -33,6 +33,12 @@ spring-boot-starter-web + + org.apache.tomcat.embed + tomcat-embed-core + ${tomcat-embed-core.version} + +