Optimize web thread pool printing log

pull/1165/head
chen.ma 1 year ago
parent 0da5599b1d
commit 2791c41ab4

@ -17,8 +17,35 @@
package cn.hippo4j.common.enums;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* Web container enum.
*/
@RequiredArgsConstructor
public enum WebContainerEnum {
TOMCAT,
JETTY,
UNDERTOW
/**
* Tomcat
*/
TOMCAT("Tomcat"),
/**
* Jetty
*/
JETTY("Jetty"),
/**
* Undertow
*/
UNDERTOW("Undertow");
@Getter
private final String name;
@Override
public String toString() {
return getName();
}
}

@ -106,7 +106,7 @@ public class DynamicThreadPoolAutoConfiguration {
WebThreadPoolService webThreadPoolService,
Hippo4jSendMessageService hippo4jSendMessageService) {
if (bootstrapConfigProperties.getWeb() != null && StringUtil.isBlank(bootstrapConfigProperties.getWeb().getThreadPoolId())) {
bootstrapConfigProperties.getWeb().setThreadPoolId(webThreadPoolService.getWebContainerType().name());
bootstrapConfigProperties.getWeb().setThreadPoolId(webThreadPoolService.getWebContainerType().getName());
}
return new WebThreadPoolConfigChangeHandler(hippo4jSendMessageService);
}
@ -130,8 +130,8 @@ public class DynamicThreadPoolAutoConfiguration {
}
@Bean
public AdapterExecutorsRefreshListener hippo4jAdapterExecutorsListener() {
return new AdapterExecutorsRefreshListener();
public AdapterExecutorsRefreshListener hippo4jAdapterExecutorsListener(DynamicThreadPoolAdapterRegister dynamicThreadPoolAdapterRegister) {
return new AdapterExecutorsRefreshListener(dynamicThreadPoolAdapterRegister);
}
@Bean

@ -74,7 +74,7 @@ public class ConfigModeNotifyConfigBuilder implements NotifyConfigBuilder {
return resultMap;
}
if (StringUtil.isBlank(webProperties.getThreadPoolId())) {
webProperties.setThreadPoolId(webThreadPoolService.getWebContainerType().name());
webProperties.setThreadPoolId(webThreadPoolService.getWebContainerType().getName());
}
Map<String, List<NotifyConfigDTO>> webSingleNotifyConfigMap =
buildSingleNotifyConfig(webProperties);

@ -102,7 +102,7 @@ public class WebExecutorRefreshListener extends AbstractRefreshListener<WebExecu
.nowMaximumPoolSize(now.getMaxSize())
.beforeKeepAliveTime(before.getKeepAliveTime())
.nowKeepAliveTime(now.getKeepAliveTime()).build();
changeNotifyRequest.setThreadPoolId(webThreadPoolService.getWebContainerType().name());
changeNotifyRequest.setThreadPoolId(webThreadPoolService.getWebContainerType().getName());
return changeNotifyRequest;
}

Loading…
Cancel
Save