-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement
Milestone
Description
Overview
After experimenting with our newly introduced core retry support (RetryPolicy, RetryTemplate, etc.) and @Retryable support, it has become apparent that there are overlapping concerns between the current RetryPolicy and BackOff contracts.
RetryPolicyandBackOffboth have stateful executions:RetryExecutionandBackOffExecution. However, only one stateful execution is necessary.FixedBackOffandExponentialBackOffalready incorporate "retry" logic in terms of max attempts, max elapsed time, etc. Thus, there is no need to duplicate such behavior in aRetryPolicyand itsRetryExecution.RetryTemplatecurrently accepts both aRetryPolicyand aBackOffin order to instrument the retry algorithm. However, users would probably rather focus on configuring all "retry" logic via a single mechanism.
Deliverables
In light of the above, we have decided to directly incorporate BackOff in RetryPolicy. To achieve that, we will do the following.
- Remove the
RetryExecutioninterface and move itsshouldRetry()method toRetryPolicy, replacing the currentRetryExecution start()method. - Introduce a
defaultgetBackOff()method in theRetryPolicyinterface. - Completely overhaul the
RetryPolicy.Builderto provide support for configuring aBackOffstrategy. - Remove
BackOffconfiguration fromRetryTemplate.
Related Issues
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancementA general enhancement