|
20 | 20 | import io.netty.buffer.CompositeByteBuf;
|
21 | 21 | import io.netty.buffer.Unpooled;
|
22 | 22 | import io.netty.handler.ssl.OpenSsl;
|
| 23 | + |
23 | 24 | import java.net.URI;
|
24 | 25 | import java.nio.charset.StandardCharsets;
|
25 | 26 | import java.time.Duration;
|
|
33 | 34 | import java.util.concurrent.CompletableFuture;
|
34 | 35 | import java.util.function.Supplier;
|
35 | 36 | import java.util.stream.Collectors;
|
| 37 | + |
36 | 38 | import org.apache.commons.lang3.StringUtils;
|
37 | 39 | import org.apache.commons.lang3.tuple.Pair;
|
38 | 40 | import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider;
|
|
44 | 46 | import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
|
45 | 47 | import software.amazon.awssdk.core.async.AsyncRequestBody;
|
46 | 48 | import software.amazon.awssdk.core.async.AsyncResponseTransformer;
|
| 49 | +import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration; |
47 | 50 | import software.amazon.awssdk.core.exception.SdkClientException;
|
48 | 51 | import software.amazon.awssdk.http.HttpStatusCode;
|
49 | 52 | import software.amazon.awssdk.http.async.SdkAsyncHttpClient;
|
@@ -417,11 +420,17 @@ protected S3AsyncClient newS3Client(String endpoint, String region, boolean forc
|
417 | 420 | builder.httpClient(httpClient);
|
418 | 421 | builder.serviceConfiguration(c -> c.pathStyleAccessEnabled(forcePathStyle));
|
419 | 422 | builder.credentialsProvider(newCredentialsProviderChain(credentialsProviders));
|
420 |
| - builder.overrideConfiguration(b -> b.apiCallTimeout(Duration.ofMinutes(2)) |
421 |
| - .apiCallAttemptTimeout(Duration.ofSeconds(60))); |
| 423 | + builder.overrideConfiguration(clientOverrideConfiguration()); |
422 | 424 | return builder.build();
|
423 | 425 | }
|
424 | 426 |
|
| 427 | + protected ClientOverrideConfiguration clientOverrideConfiguration() { |
| 428 | + return ClientOverrideConfiguration.builder() |
| 429 | + .apiCallTimeout(Duration.ofMinutes(2)) |
| 430 | + .apiCallAttemptTimeout(Duration.ofSeconds(60)) |
| 431 | + .build(); |
| 432 | + } |
| 433 | + |
425 | 434 | private AwsCredentialsProvider newCredentialsProviderChain(List<AwsCredentialsProvider> credentialsProviders) {
|
426 | 435 | List<AwsCredentialsProvider> providers = new ArrayList<>(credentialsProviders);
|
427 | 436 | // Add default providers to the end of the chain
|
|
0 commit comments