Merge pull request #1836 from ryanjbaxter/response-code-retry

Add the ability for ribbon clients to specify response status codes they would like to retry
This commit is contained in:
Ryan Baxter
2017-04-05 14:01:15 -04:00
committed by GitHub
15 changed files with 447 additions and 75 deletions

View File

@@ -2461,6 +2461,22 @@ certain Ribbon properties. The properties you can use are
`client.ribbon.OkToRetryOnAllOperations`. See the https://github.com/Netflix/ribbon/wiki/Getting-Started#the-properties-file-sample-clientproperties[Ribbon documentation]
for a description of what there properties do.
In addition you may want to retry requests when certain status codes are returned in the
response. You can list the response codes you would like the Ribbon client to retry using the
property `clientName.ribbon.retryableStatusCodes`. For example
[source,yaml]
----
clientName:
ribbon:
retryableStatusCodes: 404,502
----
You can also create a bean of type `LoadBalancedRetryPolicy` and implement the `retryableStatusCode`
method to determine whether you want to retry a request given the status code.
==== Zuul
You can turn off Zuul's retry functionality by setting `zuul.retryable` to `false`. You