mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
commit
6411a24719
@ -1,6 +1,7 @@
|
||||
server.port=18082
|
||||
spring.application.name=service-provider
|
||||
spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848
|
||||
#spring.cloud.nacos.discovery.instance-enabled=true
|
||||
|
||||
spring.cloud.nacos.username=nacos
|
||||
spring.cloud.nacos.password=nacos
|
||||
|
@ -199,6 +199,11 @@ public class NacosDiscoveryProperties {
|
||||
*/
|
||||
private Integer ipDeleteTimeout;
|
||||
|
||||
/**
|
||||
* If instance is enabled to accept request. The default value is true.
|
||||
*/
|
||||
private boolean instanceEnabled = true;
|
||||
|
||||
@Autowired
|
||||
private InetUtils inetUtils;
|
||||
|
||||
@ -448,6 +453,14 @@ public class NacosDiscoveryProperties {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public boolean isInstanceEnabled() {
|
||||
return instanceEnabled;
|
||||
}
|
||||
|
||||
public void setInstanceEnabled(boolean instanceEnabled) {
|
||||
this.instanceEnabled = instanceEnabled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "NacosDiscoveryProperties{" + "serverAddr='" + serverAddr + '\''
|
||||
|
@ -159,6 +159,7 @@ public class NacosServiceRegistry implements ServiceRegistry<Registration> {
|
||||
instance.setPort(registration.getPort());
|
||||
instance.setWeight(nacosDiscoveryProperties.getWeight());
|
||||
instance.setClusterName(nacosDiscoveryProperties.getClusterName());
|
||||
instance.setEnabled(nacosDiscoveryProperties.isInstanceEnabled());
|
||||
instance.setMetadata(registration.getMetadata());
|
||||
|
||||
return instance;
|
||||
|
@ -23,6 +23,12 @@
|
||||
"defaultValue": true,
|
||||
"description": "enable nacos discovery or not."
|
||||
},
|
||||
{
|
||||
"name": "spring.cloud.nacos.discovery.instance-enabled",
|
||||
"type": "java.lang.Boolean",
|
||||
"defaultValue": true,
|
||||
"description": "If instance is enabled to accept request. The default value is true."
|
||||
},
|
||||
{
|
||||
"name": "spring.cloud.nacos.discovery.namingLoadCacheAtStart",
|
||||
"type": "java.lang.Boolean",
|
||||
|
Loading…
x
Reference in New Issue
Block a user