mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
[Issues] 765 Support customized beat interval of Nacos client
This commit is contained in:
parent
d332ae666b
commit
3860f5eabb
@ -142,7 +142,7 @@ public class NacosDiscoveryProperties {
|
||||
*/
|
||||
private String secretKey;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Heart beat interval. Time unit: second.
|
||||
*/
|
||||
private Integer heartBeatInterval;
|
||||
@ -349,21 +349,21 @@ public class NacosDiscoveryProperties {
|
||||
this.heartBeatInterval = heartBeatInterval;
|
||||
}
|
||||
|
||||
public Integer getHeartBeatTimeout() {
|
||||
return heartBeatTimeout;
|
||||
}
|
||||
public Integer getHeartBeatTimeout() {
|
||||
return heartBeatTimeout;
|
||||
}
|
||||
|
||||
public void setHeartBeatTimeout(Integer heartBeatTimeout) {
|
||||
this.heartBeatTimeout = heartBeatTimeout;
|
||||
}
|
||||
public void setHeartBeatTimeout(Integer heartBeatTimeout) {
|
||||
this.heartBeatTimeout = heartBeatTimeout;
|
||||
}
|
||||
|
||||
public Integer getIpDeleteTimeout() {
|
||||
return ipDeleteTimeout;
|
||||
}
|
||||
public Integer getIpDeleteTimeout() {
|
||||
return ipDeleteTimeout;
|
||||
}
|
||||
|
||||
public void setIpDeleteTimeout(Integer ipDeleteTimeout) {
|
||||
this.ipDeleteTimeout = ipDeleteTimeout;
|
||||
}
|
||||
public void setIpDeleteTimeout(Integer ipDeleteTimeout) {
|
||||
this.ipDeleteTimeout = ipDeleteTimeout;
|
||||
}
|
||||
|
||||
public String getNamingLoadCacheAtStart() {
|
||||
return namingLoadCacheAtStart;
|
||||
|
@ -80,16 +80,16 @@ public class NacosRegistration implements Registration, ServiceInstance {
|
||||
|
||||
if (null != nacosDiscoveryProperties.getHeartBeatInterval()) {
|
||||
metadata.put(PreservedMetadataKeys.HEART_BEAT_INTERVAL,
|
||||
nacosDiscoveryProperties.getHeartBeatInterval().toString());
|
||||
nacosDiscoveryProperties.getHeartBeatInterval().toString());
|
||||
}
|
||||
if (null != nacosDiscoveryProperties.getHeartBeatTimeout()) {
|
||||
metadata.put(PreservedMetadataKeys.HEART_BEAT_TIMEOUT,
|
||||
nacosDiscoveryProperties.getHeartBeatTimeout().toString());
|
||||
}
|
||||
metadata.put(PreservedMetadataKeys.HEART_BEAT_TIMEOUT,
|
||||
nacosDiscoveryProperties.getHeartBeatTimeout().toString());
|
||||
}
|
||||
if (null != nacosDiscoveryProperties.getIpDeleteTimeout()) {
|
||||
metadata.put(PreservedMetadataKeys.IP_DELETE_TIMEOUT,
|
||||
nacosDiscoveryProperties.getIpDeleteTimeout().toString());
|
||||
}
|
||||
metadata.put(PreservedMetadataKeys.IP_DELETE_TIMEOUT,
|
||||
nacosDiscoveryProperties.getIpDeleteTimeout().toString());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -169,18 +169,18 @@ public class NacosAutoServiceRegistrationTests {
|
||||
}
|
||||
|
||||
private void checkoutNacosDiscoveryHeartBeatInterval() {
|
||||
assertEquals("NacosDiscoveryProperties heart beat interval was wrong", Integer.valueOf(3),
|
||||
properties.getHeartBeatInterval());
|
||||
assertEquals("NacosDiscoveryProperties heart beat interval was wrong",
|
||||
Integer.valueOf(3), properties.getHeartBeatInterval());
|
||||
}
|
||||
|
||||
private void checkoutNacosDiscoveryHeartBeatTimeout() {
|
||||
assertEquals("NacosDiscoveryProperties heart beat timeout was wrong", Integer.valueOf(6),
|
||||
properties.getHeartBeatInterval());
|
||||
assertEquals("NacosDiscoveryProperties heart beat timeout was wrong",
|
||||
Integer.valueOf(6), properties.getHeartBeatInterval());
|
||||
}
|
||||
|
||||
private void checkoutNacosDiscoveryIpDeleteTimeout() {
|
||||
assertEquals("NacosDiscoveryProperties ip delete timeout was wrong", Integer.valueOf(9),
|
||||
properties.getHeartBeatInterval());
|
||||
assertEquals("NacosDiscoveryProperties ip delete timeout was wrong",
|
||||
Integer.valueOf(9), properties.getHeartBeatInterval());
|
||||
}
|
||||
|
||||
private void checkoutNacosDiscoveryServiceName() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user