|
|
|
@ -12,17 +12,13 @@ import cn.hippo4j.common.notify.platform.WeChatSendMessageHandler;
|
|
|
|
|
import cn.hippo4j.core.config.UtilAutoConfiguration;
|
|
|
|
|
import cn.hippo4j.core.executor.ThreadPoolNotifyAlarmHandler;
|
|
|
|
|
import cn.hippo4j.core.starter.notify.CoreNotifyConfigBuilder;
|
|
|
|
|
import cn.hippo4j.core.starter.parser.ConfigParserHandler;
|
|
|
|
|
import cn.hippo4j.core.starter.refresher.ApolloRefresherHandler;
|
|
|
|
|
import cn.hippo4j.core.starter.refresher.NacosCloudRefresherHandler;
|
|
|
|
|
import cn.hippo4j.core.starter.refresher.NacosRefresherHandler;
|
|
|
|
|
import cn.hippo4j.core.starter.support.DynamicThreadPoolPostProcessor;
|
|
|
|
|
import com.alibaba.cloud.nacos.NacosConfigManager;
|
|
|
|
|
import com.alibaba.nacos.api.config.ConfigService;
|
|
|
|
|
import lombok.AllArgsConstructor;
|
|
|
|
|
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingClass;
|
|
|
|
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
@ -48,7 +44,7 @@ public class DynamicThreadPoolCoreAutoConfiguration {
|
|
|
|
|
|
|
|
|
|
private static final String NACOS_CONFIG_KEY = "com.alibaba.nacos.api.config";
|
|
|
|
|
|
|
|
|
|
private static final String APOLLO_CONFIG_KEY = "com.ctrip.framework.apollo.ConfigService.class";
|
|
|
|
|
private static final String APOLLO_CONFIG_KEY = "com.ctrip.framework.apollo.ConfigService";
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
@Order(Ordered.HIGHEST_PRECEDENCE)
|
|
|
|
@ -100,22 +96,19 @@ public class DynamicThreadPoolCoreAutoConfiguration {
|
|
|
|
|
@Bean
|
|
|
|
|
@ConditionalOnClass(name = NACOS_CONFIG_KEY)
|
|
|
|
|
@ConditionalOnMissingClass(NACOS_CONFIG_MANAGER_KEY)
|
|
|
|
|
public NacosRefresherHandler nacosRefresherHandler(ConfigService configService,
|
|
|
|
|
ThreadPoolNotifyAlarmHandler threadPoolNotifyAlarmHandler,
|
|
|
|
|
public NacosRefresherHandler nacosRefresherHandler(ThreadPoolNotifyAlarmHandler threadPoolNotifyAlarmHandler,
|
|
|
|
|
BootstrapCoreProperties bootstrapCoreProperties) {
|
|
|
|
|
return new NacosRefresherHandler(configService, threadPoolNotifyAlarmHandler, bootstrapCoreProperties);
|
|
|
|
|
return new NacosRefresherHandler(threadPoolNotifyAlarmHandler, bootstrapCoreProperties);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
@ConditionalOnClass(name = NACOS_CONFIG_MANAGER_KEY)
|
|
|
|
|
public NacosCloudRefresherHandler nacosCloudRefresherHandler(NacosConfigManager nacosConfigManager,
|
|
|
|
|
ThreadPoolNotifyAlarmHandler threadPoolNotifyAlarmHandler,
|
|
|
|
|
public NacosCloudRefresherHandler nacosCloudRefresherHandler(ThreadPoolNotifyAlarmHandler threadPoolNotifyAlarmHandler,
|
|
|
|
|
BootstrapCoreProperties bootstrapCoreProperties) {
|
|
|
|
|
return new NacosCloudRefresherHandler(nacosConfigManager, threadPoolNotifyAlarmHandler, bootstrapCoreProperties);
|
|
|
|
|
return new NacosCloudRefresherHandler(threadPoolNotifyAlarmHandler, bootstrapCoreProperties);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Bean
|
|
|
|
|
@ConditionalOnMissingBean
|
|
|
|
|
@ConditionalOnClass(name = APOLLO_CONFIG_KEY)
|
|
|
|
|
public ApolloRefresherHandler apolloRefresher(ThreadPoolNotifyAlarmHandler threadPoolNotifyAlarmHandler,
|
|
|
|
|
BootstrapCoreProperties bootstrapCoreProperties) {
|
|
|
|
|