Repository navigation
Description
Is there an existing issue for this?
- I have searched the existing issues
Current Behavior
The HTTP client plugin appears to support multiple retry backoff strategies (default, fixed, exponential, custom), but current master cannot select any non-default strategy through built-in code.
AbstractHttpClientPlugin reads the strategy type from an exchange attribute:
String retryStrategyType = (String) Optional
.ofNullable(exchange.getAttribute(Constants.HTTP_RETRY_BACK_OFF_SPEC))
.orElse(HttpRetryBackoffSpecEnum.getDefault());However Constants.HTTP_RETRY_BACK_OFF_SPEC is currently defined as the literal string "default", so it is used as the exchange attribute key. I could not find any current code path that writes an exchange attribute with that key. As a result, the code always falls back to HttpRetryBackoffSpecEnum.getDefault() and the fixed / exponential / custom branches are effectively unreachable from built-in configuration.
There is also a hard failure if anything does force the custom branch: CustomRetryStrategy#execute(...) currently returns null, and AbstractHttpClientPlugin immediately calls methods on the returned Mono, causing a NullPointerException.
Expected Behavior
Non-default retry backoff strategies should either be configurable and stored in the exchange under a real attribute key, or the dead strategy branches should be removed/disabled until they are supported.
The custom strategy should not return null; if it is unsupported, it should fail explicitly or be excluded from selection.
Steps To Reproduce
- Configure an HTTP route with retry enabled.
- Try to select a non-default backoff strategy such as
fixedorexponentialthrough the available rule/configuration path. - The HTTP client still uses the default strategy because no built-in code writes
exchange.setAttribute(Constants.HTTP_RETRY_BACK_OFF_SPEC, "fixed")or similar. - If an extension manually writes the attribute value
custom,CustomRetryStrategy#execute(...)returnsnulland the request fails with NPE.
Environment
ShenYu version(s): current masterDebug logs
No response
Anything else?
Relevant current-master files:
shenyu-common/src/main/java/org/apache/shenyu/common/constant/Constants.javashenyu-plugin/shenyu-plugin-httpclient/src/main/java/org/apache/shenyu/plugin/httpclient/AbstractHttpClientPlugin.javashenyu-plugin/shenyu-plugin-httpclient/src/main/java/org/apache/shenyu/plugin/httpclient/CustomRetryStrategy.java
Activity
github-actions commentedon Jul 31, 2026
👋 Hello @Aias00
A new issue has been opened by @Aias00:
Please review when you have time. Thank you! 🙏
hengyuss commentedon Aug 1, 2026
/assign