Browse Source

Merge pull request #194 from ryanjbaxter/make-retry-enabled-default-true

Set spring.cloud.loadbalancer.retry.enabled to true by default
pull/183/head
Ryan Baxter 8 years ago committed by GitHub
parent
commit
8b9821dd90
  1. 7
      docs/src/main/asciidoc/spring-cloud-commons.adoc
  2. 2
      spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerRetryProperties.java

7
docs/src/main/asciidoc/spring-cloud-commons.adoc

@ -362,9 +362,10 @@ for details of how the `RestTemplate` is set up. @@ -362,9 +362,10 @@ for details of how the `RestTemplate` is set up.
==== Retrying Failed Requests
A load balanced `RestTemplate` can be configured to retry failed requests.
By default this logic is disabled, you can enable it by setting
`spring.cloud.loadbalancer.retry.enabled=true` and adding link:https://github.com/spring-projects/spring-retry[Spring Retry] to your application's classpath. The load balanced `RestTemplate` will
honor some of the Ribbon configuration values related to retrying failed requests.
By default this logic is disabled, you can enable it by adding link:https://github.com/spring-projects/spring-retry[Spring Retry] to your application's classpath. The load balanced `RestTemplate` will
honor some of the Ribbon configuration values related to retrying failed requests. If
you would like to disable the retry logic with Spring Retry on the classpath
you can set `spring.cloud.loadbalancer.retry.enabled=false`.
The properties you can use are `client.ribbon.MaxAutoRetries`,
`client.ribbon.MaxAutoRetriesNextServer`, and `client.ribbon.OkToRetryOnAllOperations`.
See the https://github.com/Netflix/ribbon/wiki/Getting-Started#the-properties-file-sample-clientproperties[Ribbon documentation]

2
spring-cloud-commons/src/main/java/org/springframework/cloud/client/loadbalancer/LoadBalancerRetryProperties.java

@ -23,7 +23,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties; @@ -23,7 +23,7 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
*/
@ConfigurationProperties("spring.cloud.loadbalancer.retry")
public class LoadBalancerRetryProperties {
private boolean enabled = false;
private boolean enabled = true;
/**
* Returns true if the load balancer should retry failed requests.

Loading…
Cancel
Save