Skip to content

Commit 214fabd

Browse files
Enable AwsKms Client Caching by default to match KmsMasterKeyProvider
1 parent 876dd5e commit 214fabd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/main/java/com/amazonaws/encryptionsdk/kms/AwsKmsClientSupplier.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class Builder {
8989
private ClientConfiguration clientConfiguration;
9090
private Set<String> allowedRegions = Collections.emptySet();
9191
private Set<String> excludedRegions = Collections.emptySet();
92-
private boolean clientCachingEnabled = false;
92+
private boolean clientCachingEnabled = true;
9393
private final Map<String, AWSKMS> clientsCache = new HashMap<>();
9494
private static final Set<String> AWSKMS_METHODS = new HashSet<>();
9595
private AWSKMSClientBuilder awsKmsClientBuilder;
@@ -188,7 +188,8 @@ public Builder excludedRegions(Set<String> regions) {
188188
}
189189

190190
/**
191-
* When set to true, allows for the AWSKMS client for each region to be cached and reused.
191+
* When set to false, disables the AWSKMS client for each region from being cached and reused.
192+
* By default, client caching is enabled.
192193
*
193194
* @param enabled Whether or not caching is enabled.
194195
*/

src/test/java/com/amazonaws/encryptionsdk/kms/AwsKmsClientSupplierTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ void testClientCachingDisabled() {
128128
@Test
129129
void testClientCaching() {
130130
AwsKmsClientSupplier supplier = new AwsKmsClientSupplier.Builder(kmsClientBuilder)
131-
.clientCaching(true)
132131
.build();
133132

134133
when(kmsClientBuilder.withRegion(REGION_1)).thenReturn(kmsClientBuilder);

0 commit comments

Comments
 (0)