-
Notifications
You must be signed in to change notification settings - Fork 853
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
equivalent of static RetryCondition defaultRetryCondition() #5392
Comments
The equivalent will be to use the static method StandardRetryStrategy.Builder builder = StandardRetryStrategy.builder();
builder = AwsRetryStrategy.configure(builder);
StandardRetryStrategy retryStrategy = builder.build(); Notice that the retry strategies returned by the static methods in StandardRetryStrategy builder = AwsRetryStrategy.standardRetryStrategy(); Please elaborate on your use case and what you're trying to accomplish if you need a more nuance answer. |
Thanks a lot, @sugmanue. It is very helpful. There are 2 things I am trying
public final CustomRetryCondition implements RetryCondition {
public boolean shouldRetry(RetryPolicyContext context) {
SdkException exn = context.exception()...
// test your condition here
}
} New Code: Public final CustomRetryPredicate implements Predicate<SdkException> {
public boolean test(SDKException exn) {
// test your condition here
}
}
|
For the first point, what's preventing you from implementing the predicate? For the second point, you can see how is done by the SDK here which gets called here. Notice that the SDK is designed to be generic and not necessarily tied to AWS, therefore we put the generic logic (including retrying on specific status code on the |
Thanks a lot, @sugmanue. No issues on First point. For the second point, thanks a lot for your sample code. |
This issue is now closed. Comments on closed issues are hard for our team to see. |
Describe the issue
I'm just upgraded to 2.26.16 and I had a RetryCondition defaultRetryCondition()
I have to use RetryStrategy.Builder.html#retryOnException(java.util.function.Predicate)).
Deprecated.
Use instead RetryStrategy.Builder.retryOnException(Predicate).
Is there an equivalent or Predicate for defaultRetryCondition?
Links
https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/retry/conditions/RetryCondition.html#defaultRetryCondition()
The text was updated successfully, but these errors were encountered: