mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
feat: use ConditionalOnEnabledHealthIndicator condition with NacosConfigHealthIndicator & AcmHealthIndicator & RocketMQBinderHealthIndicator & SidecarHealthIndicator
[fix #1276] https://github.com/alibaba/spring-cloud-alibaba/issues/1276
This commit is contained in:
@@ -21,6 +21,7 @@ import com.alibaba.cloud.nacos.refresh.NacosRefreshHistory;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.actuate.autoconfigure.endpoint.condition.ConditionalOnEnabledEndpoint;
|
||||
import org.springframework.boot.actuate.autoconfigure.health.ConditionalOnEnabledHealthIndicator;
|
||||
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
||||
@@ -52,8 +53,7 @@ public class NacosConfigEndpointAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
@ConditionalOnMissingBean
|
||||
@ConditionalOnProperty(name = "spring.cloud.nacos.config.health.enabled",
|
||||
matchIfMissing = true)
|
||||
@ConditionalOnEnabledHealthIndicator("nacos-config")
|
||||
public NacosConfigHealthIndicator nacosConfigHealthIndicator() {
|
||||
return new NacosConfigHealthIndicator(nacosConfigManager.getConfigService());
|
||||
}
|
||||
|
@@ -55,12 +55,6 @@
|
||||
"type": "java.util.List",
|
||||
"description": "a set of extensional configurations .e.g: spring.cloud.nacos.config.extension-configs[0]=xxx ."
|
||||
},
|
||||
{
|
||||
"name": "spring.cloud.nacos.config.health.enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"defaultValue": true,
|
||||
"description": "the switch for health check, it default enabled(true)."
|
||||
},
|
||||
{
|
||||
"name": "spring.cloud.nacos.config.refresh-enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
|
Reference in New Issue
Block a user