From cca0901a5ea481c9b037f2e6727063d8e9b2d5e3 Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Wed, 17 Oct 2018 10:51:02 -0400 Subject: [PATCH] Updates to using retry with forward protocol --- docs/src/main/asciidoc/spring-cloud-gateway.adoc | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/src/main/asciidoc/spring-cloud-gateway.adoc b/docs/src/main/asciidoc/spring-cloud-gateway.adoc index e94f6007..a4345888 100644 --- a/docs/src/main/asciidoc/spring-cloud-gateway.adoc +++ b/docs/src/main/asciidoc/spring-cloud-gateway.adoc @@ -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