0

I`m migrating and upgrading the project, from Spring Cloud Netflix to New Spring Cloud(Spring loadbalancer CircuitBreak).

https://spring.io/blog/2018/12/12/spring-cloud-greenwich-rc1-available-now#spring-cloud-netflix-projects-entering-maintenance-mode

I have some configurations where I can't find the equivalent config in Spring loadbalancer And CircuitBreak. In my limited experience with Spring ,I searching for a long time on net. But no use. --Here is my questions:

old-ribbon-config migration to loadbalancer:

serverName.ribbon.MaxAutoRetries=0
serverName.ribbon.MaxAutoRetriesNextServer=2
serverName.ribbon.retryableStatusCodes=503
serverName.ribbon.NFLoadBalancerRuleClassName=com.netflix.loadbalancer.RoundRobinRule
serverName.ribbon.ReadTimeout=5000
serverName.ribbon.ConnectTimeout=5000

serverName2.ribbon.ReadTimeout=6000
serverName2.ribbon.ConnectTimeout=7000

The closest configuration as below: But I need to configure it for each server-name particularly the 'MaxAutoRetriesNextServer' and enabled retry for per server-name.

spring.cloud.loadbalancer.retry.enabled=false
spring.cloud.loadbalancer.retry.max-retries-on-same-service-instance=0
spring.cloud.loadbalancer.retry.max-retries-on-next-service-instance=2

The other configuration is hystrix timeout, In resilience4j it needs to return a CompletedFuture type, which is not compatible with older code.

old-hystrix-config migration to resilience4j:

    hystrix.command.FeignClientName#method(String).execution.isolation.thread.timeoutInMilliseconds=2000
        
    
resilience4j.timelimiter.instances.name.timeout-duration=6s

What would be the best way to do that? Thanks in advance!

zy_sun
  • 175
  • 1
  • 11

0 Answers0