You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
does not result in a backoff delay pulled from the delayExpression as intended, but rather uses the default delay of 1000ms.
Debugging through the code, BackoffPolicyBuilder.build() correctly receives the delaySupplier with the value pulled from ${application.config.retryDelayTimeMs}, but only applies this field if a multiplier is present, or if a maxDelay is specified. If neither of these are true, then a FixedBackoffPolicy is instantiated, populated with the default delay of 1000ms and a sleeper, and returned.
FixedBackoffPolicy can support a backoff period supplier, but none is set in the BackoffPolicyBuilder.build() method.
This can be worked around by adding a multiplier of 1, or by adding a maxDelay to the backoff annotation, thus directing the BackoffPolicyBuilder to the sections of the build() method that take into account the delay expression. However, seems like a FixedBackoffPolicy can be generated that uses the specified delay expression, without having to set these other annotation attributes.
The text was updated successfully, but these errors were encountered:
Expressions are parsed correctly prior to invoking the BackoffPolicyBuilder, specifically in AnnotationAwareRetryOperationsInterceptor.getBackoffPolicy() line 408-414 and 418-424, but for spel expressions wrapped in #{...}, not for property expressions ${...}. (See the isTemplate() method.) If the property expression is wrapped in #{...}, then the expression is parsed correctly. Here is an example.
An annotation like this
does not result in a backoff delay pulled from the delayExpression as intended, but rather uses the default delay of 1000ms.
Debugging through the code,
BackoffPolicyBuilder.build()
correctly receives the delaySupplier with the value pulled from${application.config.retryDelayTimeMs}
, but only applies this field if a multiplier is present, or if a maxDelay is specified. If neither of these are true, then a FixedBackoffPolicy is instantiated, populated with the default delay of 1000ms and a sleeper, and returned.FixedBackoffPolicy can support a backoff period supplier, but none is set in the
BackoffPolicyBuilder.build()
method.This can be worked around by adding a multiplier of 1, or by adding a maxDelay to the backoff annotation, thus directing the
BackoffPolicyBuilder
to the sections of thebuild()
method that take into account the delay expression. However, seems like aFixedBackoffPolicy
can be generated that uses the specified delay expression, without having to set these other annotation attributes.The text was updated successfully, but these errors were encountered: