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