3
3
import software .amazon .awssdk .core .client .config .ClientOverrideConfiguration ;
4
4
import software .amazon .awssdk .core .internal .retry .SdkDefaultRetrySetting ;
5
5
import software .amazon .awssdk .core .exception .AbortedException ;
6
- import software .amazon .awssdk .core .exception .SdkClientException ;
7
6
import software .amazon .awssdk .core .retry .RetryPolicy ;
7
+ import software .amazon .awssdk .core .retry .RetryPolicyContext ;
8
8
import software .amazon .awssdk .core .retry .backoff .BackoffStrategy ;
9
9
import software .amazon .awssdk .core .retry .backoff .EqualJitterBackoffStrategy ;
10
10
import software .amazon .awssdk .core .retry .conditions .OrRetryCondition ;
@@ -81,14 +81,14 @@ private static RetryPolicy getRetryPolicy() {
81
81
private static RetryCondition getRetryCondition () {
82
82
return OrRetryCondition .create (
83
83
RetryCondition .defaultRetryCondition (), // Pull in SDK defaults
84
- retryAbortedExceptionCondition () // https://github.com/aws/aws-sdk-java-v2/issues/1684
84
+ shouldRetryAbortedException () // https://github.com/aws/aws-sdk-java-v2/issues/1684
85
85
);
86
86
}
87
87
88
- private static RetryCondition retryAbortedExceptionCondition () {
89
- return c -> c . exception (). getClass (). equals ( SdkClientException . class ) &&
90
- c .exception ().getCause () != null &&
91
- c .exception ().getCause ().getClass ().equals (AbortedException .class );
88
+ private static RetryCondition shouldRetryAbortedException () {
89
+ return ( RetryPolicyContext c ) ->
90
+ c .exception ().getCause () != null &&
91
+ c .exception ().getCause ().getClass ().equals (AbortedException .class );
92
92
}
93
93
94
94
private static SdkHttpClient getHttpClient () {
@@ -98,7 +98,7 @@ private static SdkHttpClient getHttpClient() {
98
98
.build ();
99
99
}
100
100
101
- public static ClientOverrideConfiguration getClientConfiguration () {
101
+ static ClientOverrideConfiguration getClientConfiguration () {
102
102
return ClientOverrideConfiguration .builder ()
103
103
.retryPolicy (getRetryPolicy ())
104
104
.apiCallTimeout (OVERALL_TIMEOUT )
0 commit comments