Allow RetryStrategy to use information from RetryPolicyContext in BackoffStrategy #5303
Closed
2 tasks
Labels
feature-request
A feature should be added or improved.
Describe the feature
The new
BackoffStrategy
used byRetryStrategy
should allow the methodcomputeDelay
to rely on more information than just the running attempt count, as does the old one used byRetryPolicy
.Use Case
While trying to switch from the now deprecated
RetryPolicy
to aRetryStrategy
-based client, I noticed that I am unable to keep the same behaviour because my custom...retry.backoff.BackoffStrategy::computeDelayBeforeNextRetry
implementation relies on theRetryPolicyContext
to decide on the actual duration and log some stuff as a side effect. The replacement...retries.api.BackoffStrategy::computeDelay
only allows access to the running attempt count.Proposed Solution
As
RetryPolicyContext
has not been yet deprecated, I hope it still fits with the newRetryStrategy
concept somehow.Other Information
I may be doing this very wrong. In that case, kindly redirect me to the correct solution.
Acknowledgements
AWS Java SDK version used
2.26.3
JDK version used
openjdk version "22.0.1" 2024-04-16
Operating System and version
Ubuntu 22.04.1
The text was updated successfully, but these errors were encountered: