The RetryFilterFunctions.RetryConfig class in the spring-cloud-gateway-server-webmvc module does not support backoff configuration, while the reactive (WebFlux) variant (RetryGatewayFilterFactory) does.
Current state
Neither of the two current MVC retry implementations supports backoff:
GatewayRetryFilterFunctions — Spring Retry-based, deprecated (Spring Retry is in maintenance-only mode)
FrameworkRetryFilterFunctions — Spring Framework retry-based, the new preferred path
Neither exposes a backoff option, and RetryConfig has no backoff field or setter.
This was previously noted with a // TODO: backoff comment in the old RetryFilterFunctions before the refactoring.
Expected behavior
RetryConfig should support backoff configuration equivalent to what the reactive module offers via RetryGatewayFilterFactory, e.g.:
.filter(retry(config -> {
config.setRetries(3);
config.setBackoff(Duration.ofMillis(100), Duration.ofMillis(500), 2, false);
}))
And YAML parity with the reactive module:
filters:
- name: Retry
args:
retries: 3
backoff:
firstBackoff: 100ms
maxBackoff: 500ms
factor: 2
basedOnPreviousValue: false
Version
spring-cloud-gateway-server-webmvc — main branch (post-refactoring to FrameworkRetryFilterFunctions)
The
RetryFilterFunctions.RetryConfigclass in thespring-cloud-gateway-server-webmvcmodule does not support backoff configuration, while the reactive (WebFlux) variant (RetryGatewayFilterFactory) does.Current state
Neither of the two current MVC retry implementations supports backoff:
GatewayRetryFilterFunctions— Spring Retry-based, deprecated (Spring Retry is in maintenance-only mode)FrameworkRetryFilterFunctions— Spring Framework retry-based, the new preferred pathNeither exposes a backoff option, and
RetryConfighas no backoff field or setter.This was previously noted with a
// TODO: backoffcomment in the oldRetryFilterFunctionsbefore the refactoring.Expected behavior
RetryConfigshould support backoff configuration equivalent to what the reactive module offers viaRetryGatewayFilterFactory, e.g.:And YAML parity with the reactive module:
Version
spring-cloud-gateway-server-webmvc—mainbranch (post-refactoring toFrameworkRetryFilterFunctions)