相关文章推荐
有胆有识的黄瓜  ·  java - ...·  1 年前    · 
想出家的拐杖  ·  python读取tar文件-掘金·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I'm using Spring, Eureka and Ribbon. I want to change the refresh interval for ribbon. While reading the documentation, I found out that I should set the following property:

my-service.ribbon.ServerListRefreshInterval=99999

However, it doesn't help because when I create a load balancer, Spring uses the following constructor

   public DynamicServerListLoadBalancer(IClientConfig clientConfig, IRule rule, IPing ping, 
        ServerList<T> serverList, ServerListFilter<T> filter) {
    this(
            clientConfig,
            rule,
            ping,
            serverList,
            filter,
            new PollingServerListUpdater()

And this constructor doesn't use my property.

I had a look at this topic : How to override the ribbon.serverListRefreshInterval default value in Spring Cloud Ribbon?

The problem is related to this bug : ribbon.ServerListRefreshInterval ignored #1304.

The bug has been solved in spring-cloud-netflix 1.3.0.RC1 on March 2017 .

You are using Spring Cloud Camden.SR7 which uses Spring Cloud Netflix 1.2.7.RELEASE, where the bug wasn't fixed yet.

Either force the use of spring-cloud-netflix 1.3.0 or above, or switch to a Spring Cloud version that contains this kind of dependency, e.g Spring Cloud Edgware.SR2 (Maven repo) which uses Spring Cloud Netflix 1.4.3.RELEASE

Thank you. It's help me, but now the clientConfig doesn't see my-service.ribbon.ServerListRefreshInterval property? Can you help with this problem? I can fix it with use ConfigurationManager.loadPropertiesFromResources("sample-client.properties"); but I think that this is not a good way – Иван Гладуш Feb 20, 2018 at 14:30 Maybe you could try a version of Spring Cloud nearest to Camden.SR7, maybe Dalston.RELEASE (Maven : mvnrepository.com/artifact/org.springframework.cloud/…) which uses Spring Cloud Netflix 1.3.0 : spring.io/blog/2017/04/12/spring-cloud-dalston-released – Arnaud Feb 20, 2018 at 15:01

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.