File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
g11n-ws/modules/md-data-api-s3impl/src/main/java/com/vmware/vip/messages/data/conf Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 1
1
/**
2
- * Copyright 2019-2023 VMware, Inc.
2
+ * Copyright 2019-2024 VMware, Inc.
3
3
* SPDX-License-Identifier: EPL-2.0
4
4
*/
5
5
package com .vmware .vip .messages .data .conf ;
12
12
import org .springframework .context .annotation .Configuration ;
13
13
import org .springframework .context .annotation .Profile ;
14
14
15
+ import com .amazonaws .ClientConfiguration ;
15
16
import com .amazonaws .auth .AWSCredentialsProvider ;
16
17
import com .amazonaws .auth .AWSStaticCredentialsProvider ;
17
18
import com .amazonaws .auth .BasicAWSCredentials ;
@@ -112,8 +113,9 @@ private synchronized AmazonS3 getAmazonS3() {
112
113
sessionCreds .getAccessKeyId (),
113
114
sessionCreds .getSecretAccessKey (),
114
115
sessionCreds .getSessionToken ());
116
+ ClientConfiguration clientConfiguration = new ClientConfiguration ().withMaxErrorRetry (5 ).withMaxConnections (config .getS3ClientMaxConnections ());
115
117
return AmazonS3ClientBuilder .standard ().withCredentials (new AWSStaticCredentialsProvider (sessionCredentials ))
116
- .withRegion (config .getS3Region ()).enablePathStyleAccess ().build ();
118
+ .withRegion (config .getS3Region ()).withClientConfiguration ( clientConfiguration ). enablePathStyleAccess ().build ();
117
119
}
118
120
119
121
Original file line number Diff line number Diff line change @@ -80,7 +80,8 @@ public class S3Config {
80
80
@ Value ("${allow.list.path.bucketName:}" )
81
81
private String allowListBucketName ;
82
82
83
-
83
+ @ Value ("${s3.client.max.connections:500}" )
84
+ private int s3ClientMaxConnections ;
84
85
85
86
public String getAccessKey () {
86
87
if (this .encryption ) {
@@ -159,6 +160,10 @@ public String getRoleArn() {
159
160
return roleArn ;
160
161
}
161
162
163
+ public int getS3ClientMaxConnections () {
164
+ return s3ClientMaxConnections ;
165
+ }
166
+
162
167
public String getAllowListBucketName () {
163
168
if (this .allowListBucketName != null && (!this .allowListBucketName .isBlank ())){
164
169
return this .allowListBucketName ;
You can’t perform that action at this time.
0 commit comments