Updates to using retry with forward protocol

This commit is contained in:
Ryan Baxter
2018-10-17 10:51:02 -04:00
committed by GitHub
parent 83445e14b9
commit cca0901a5e

View File

@@ -773,10 +773,7 @@ spring:
statuses: BAD_GATEWAY
----
NOTE: When using the retry filter with a URI that uses the `forward` protocol, the endpoint you forward to should
not return a `ResponseEntity` or else the retry filter will not be able to retry the request do to the response
already being committed in the exchange. Instead the endpoint should throw an exception and the retry filter
should be configured to retry on that exception.
NOTE: When using the retry filter with a `forward:` prefixed URL, the target endpoint should be written carefully so that in case of an error it does not do anything that could result in a response being sent to the client and committed. For example, if the target endpoint is an annotated controller, the target controller method should not return `ResponseEntity` with an error status code. Instead it should throw an `Exception`, or signal an error, e.g. via a `Mono.error(ex)` return value, which the retry filter can be configured to handle by retrying.
== Global Filters