diff --git a/spring-cloud-alibaba-nacos-config/src/main/java/org/springframework/cloud/alibaba/nacos/NacosConfigProperties.java b/spring-cloud-alibaba-nacos-config/src/main/java/org/springframework/cloud/alibaba/nacos/NacosConfigProperties.java index 666051459..1518dcff1 100644 --- a/spring-cloud-alibaba-nacos-config/src/main/java/org/springframework/cloud/alibaba/nacos/NacosConfigProperties.java +++ b/spring-cloud-alibaba-nacos-config/src/main/java/org/springframework/cloud/alibaba/nacos/NacosConfigProperties.java @@ -55,11 +55,6 @@ public class NacosConfigProperties { private static final Logger log = LoggerFactory .getLogger(NacosConfigProperties.class); - /** - * whether to enable nacos config. - */ - private boolean enabled = true; - /** * nacos config server address */ @@ -140,19 +135,8 @@ public class NacosConfigProperties { private ConfigService configService; - @Autowired - private Environment environment; - // todo sts support - public boolean isEnabled() { - return enabled; - } - - public void setEnabled(boolean enabled) { - this.enabled = enabled; - } - public String getServerAddr() { return serverAddr; } @@ -322,16 +306,15 @@ public class NacosConfigProperties { @Override public String toString() { - return "NacosConfigProperties{" + "enabled=" + enabled + ", serverAddr='" - + serverAddr + '\'' + ", encode='" + encode + '\'' + ", group='" + group - + '\'' + ", prefix='" + prefix + '\'' + ", fileExtension='" - + fileExtension + '\'' + ", timeout=" + timeout + ", endpoint='" - + endpoint + '\'' + ", namespace='" + namespace + '\'' + ", accessKey='" - + accessKey + '\'' + ", secretKey='" + secretKey + '\'' - + ", contextPath='" + contextPath + '\'' + ", clusterName='" + clusterName - + '\'' + ", name='" + name + '\'' + ", sharedDataids='" + sharedDataids - + '\'' + ", refreshableDataids='" + refreshableDataids + '\'' - + ", extConfig=" + extConfig + '}'; + return "NacosConfigProperties{" + "serverAddr='" + serverAddr + '\'' + + ", encode='" + encode + '\'' + ", group='" + group + '\'' + ", prefix='" + + prefix + '\'' + ", fileExtension='" + fileExtension + '\'' + + ", timeout=" + timeout + ", endpoint='" + endpoint + '\'' + + ", namespace='" + namespace + '\'' + ", accessKey='" + accessKey + '\'' + + ", secretKey='" + secretKey + '\'' + ", contextPath='" + contextPath + + '\'' + ", clusterName='" + clusterName + '\'' + ", name='" + name + '\'' + + ", sharedDataids='" + sharedDataids + '\'' + ", refreshableDataids='" + + refreshableDataids + '\'' + ", extConfig=" + extConfig + '}'; } public ConfigService configServiceInstance() { diff --git a/spring-cloud-alibaba-nacos-config/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-cloud-alibaba-nacos-config/src/main/resources/META-INF/additional-spring-configuration-metadata.json index 3ce2a169d..597126e8e 100644 --- a/spring-cloud-alibaba-nacos-config/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/spring-cloud-alibaba-nacos-config/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -32,6 +32,12 @@ "name": "spring.cloud.nacos.config.ext-config", "type": "java.util.List", "description": "a set of extended configurations ." + }, + { + "name": "spring.cloud.nacos.config.enabled", + "type": "java.lang.Boolean", + "defaultValue": true, + "description": "enable nacos config or not." } ] } \ No newline at end of file