Java 如何在功能区负载平衡器中设置ServerListRefreshInterval?
我用的是弹簧、尤里卡和丝带。我想更改功能区的刷新间隔。在阅读文档时,我发现应该设置以下属性:Java 如何在功能区负载平衡器中设置ServerListRefreshInterval?,java,spring,load-balancing,spring-cloud-netflix,netflix-ribbon,Java,Spring,Load Balancing,Spring Cloud Netflix,Netflix Ribbon,我用的是弹簧、尤里卡和丝带。我想更改功能区的刷新间隔。在阅读文档时,我发现应该设置以下属性: my-service.ribbon.ServerListRefreshInterval=99999 但是,这没有帮助,因为当我创建负载平衡器时,Spring使用以下构造函数 public DynamicServerListLoadBalancer(IClientConfig clientConfig, IRule rule, IPing ping, ServerList<
my-service.ribbon.ServerListRefreshInterval=99999
但是,这没有帮助,因为当我创建负载平衡器时,Spring使用以下构造函数
public DynamicServerListLoadBalancer(IClientConfig clientConfig, IRule rule, IPing ping,
ServerList<T> serverList, ServerListFilter<T> filter) {
this(
clientConfig,
rule,
ping,
serverList,
filter,
new PollingServerListUpdater()
);
public DynamicServerListLoadBalancer(IClientConfig客户端配置、IRule规则、IPing ping、,
服务器列表(服务器列表、服务器列表过滤器过滤器){
这个(
clientConfig,
规则,
发出砰的声响,
服务器列表,
过滤器,
新的PollingServerListUpdater()
);
这个构造函数不使用我的属性。我看了一下这个主题: 此问题与此错误有关: 该漏洞已于2017年3月解决 您正在使用的是使用
Spring Cloud Netflix 1.2.7.RELEASE
,该漏洞尚未修复
强制使用spring cloud netflix 1.3.0或更高版本,或切换到包含此类依赖项的,例如()哪个使用了
Spring Cloud Netflix 1.4.3.RELEASE
您使用的是哪个版本的Spring Cloud Netflix?@Berger Camden.sr7谢谢。这对我很有帮助,但是现在clientConfig没有看到my-service.ribbon.ServerListRefreshInterval属性?您能帮助解决这个问题吗?我可以使用ConfigurationManager.LoadProperties Fromre解决它来源(“sample client.properties”);但我认为这不是一个好方法抱歉,我不知道为什么找不到您的属性。也许您可以尝试一个离Camden.SR7最近的Spring Cloud版本,可能是使用Spring Cloud Netflix 1.3.0的Dalston.RELEASE(Maven:):它没有帮助