Does Feign retry require some sort of configuration?

后端 未结 3 1826
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-06 05:41

I just tried to do a attempted a seamless upgrade of a service in a test setup. The service is being accessed by a Feign client. And naively I was under the impression that

相关标签:
3条回答
  • 2021-01-06 05:59

    If you are using ribbon you can set properties similar to the following (substituting "localapp" for your serviceid):

    localapp.ribbon.MaxAutoRetries=5
    localapp.ribbon.MaxAutoRetriesNextServer=5
    localapp.ribbon.OkToRetryOnAllOperations=true
    
    0 讨论(0)
  • 2021-01-06 06:21

    see if property works - OkToRetryOnAllOperations: true

    You can refer application -> https://github.com/spencergibb/spring-cloud-sandbox/blob/master/spring-cloud-sandbox-sample-frontend/src/main/resources/application.yml

    Spencer was quick...was late by few minutes :-)

    0 讨论(0)
  • 2021-01-06 06:22

    ps underneath Feign has a Retryer interface, which was made to support things like Ribbon.

    https://github.com/Netflix/feign/blob/master/core/src/main/java/feign/Retryer.java

    0 讨论(0)
提交回复
热议问题