4

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 with multiple instances available of the service, the client would retry another instance if it failed to connect to one.

That, however, did not happen. But I cannot find any mention of how Feign in Spring Cloud is supposed to be configured to do this? Although I have seen mentions of it supporting it (as opposed to using RestTemplate where you would use something like Spring Retry?)

4

3 回答 3

3

如果您使用的是功能区,您可以设置类似于以下内容的属性(将“localapp”替换为您的 serviceid):

localapp.ribbon.MaxAutoRetries=5
localapp.ribbon.MaxAutoRetriesNextServer=5
localapp.ribbon.OkToRetryOnAllOperations=true
于 2015-03-20T16:28:07.507 回答
2

Feign 下的 ps 有一个 Retryer 接口,用于支持 Ribbon 之类的东西。

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

于 2015-04-13T15:16:06.887 回答
1

看看属性是否有效 - OkToRetryOnAllOperations: true

您可以参考应用程序-> https://github.com/spencergibb/spring-cloud-sandbox/blob/master/spring-cloud-sandbox-sample-frontend/src/main/resources/application.yml

斯宾塞很快......迟到了几分钟:-)

于 2015-03-20T16:30:42.440 回答