nacos discovery endpoint support spring.cloud.nacos.discovery.enabled , Polish #411

pull/416/head
flystar32 6 years ago
parent 9c5d9229e5
commit 9860c5ac8e

@ -18,6 +18,7 @@ package org.springframework.cloud.alibaba.nacos.discovery;
import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.AutoConfigureBefore;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cloud.alibaba.nacos.ConditionalOnNacosDiscoveryEnabled; import org.springframework.cloud.alibaba.nacos.ConditionalOnNacosDiscoveryEnabled;
import org.springframework.cloud.alibaba.nacos.NacosDiscoveryProperties; import org.springframework.cloud.alibaba.nacos.NacosDiscoveryProperties;
@ -33,6 +34,7 @@ import org.springframework.context.annotation.Configuration;
@Configuration @Configuration
@ConditionalOnNacosDiscoveryEnabled @ConditionalOnNacosDiscoveryEnabled
@EnableConfigurationProperties @EnableConfigurationProperties
@ConditionalOnProperty(value = "spring.cloud.nacos.discovery.enabled", matchIfMissing = true)
@AutoConfigureBefore({ SimpleDiscoveryClientAutoConfiguration.class, @AutoConfigureBefore({ SimpleDiscoveryClientAutoConfiguration.class,
CommonsClientAutoConfiguration.class }) CommonsClientAutoConfiguration.class })
public class NacosDiscoveryClientAutoConfiguration { public class NacosDiscoveryClientAutoConfiguration {

@ -5,6 +5,12 @@
"defaultValue": "${spring.application.name}", "defaultValue": "${spring.application.name}",
"description": "the service name to register, default value is ${spring.application.name}." "description": "the service name to register, default value is ${spring.application.name}."
}, },
{
"name": "spring.cloud.nacos.discovery.enabled",
"type": "java.lang.Boolean",
"defaultValue": true,
"description": "enable nacos discovery or not."
},
{ {
"name": "spring.cloud.nacos.discovery.namingLoadCacheAtStart", "name": "spring.cloud.nacos.discovery.namingLoadCacheAtStart",
"type": "java.lang.Boolean", "type": "java.lang.Boolean",

Loading…
Cancel
Save