From cdd8fa8ddcecc53f2f06716d7ec691ef3ccf08f5 Mon Sep 17 00:00:00 2001 From: yurem Date: Wed, 10 Mar 2021 12:51:17 +0300 Subject: [PATCH] Add keepAliveInterval CB SDK support --- .../impl/CouchbaseEntryManagerFactory.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/persistence-couchbase/src/main/java/org/gluu/persist/couchbase/impl/CouchbaseEntryManagerFactory.java b/persistence-couchbase/src/main/java/org/gluu/persist/couchbase/impl/CouchbaseEntryManagerFactory.java index 3ad90bc23..db48ce093 100644 --- a/persistence-couchbase/src/main/java/org/gluu/persist/couchbase/impl/CouchbaseEntryManagerFactory.java +++ b/persistence-couchbase/src/main/java/org/gluu/persist/couchbase/impl/CouchbaseEntryManagerFactory.java @@ -68,32 +68,52 @@ protected void initInternal() { String sslTrustStorePin = couchbaseConnectionProperties.getProperty("ssl.trustStore.pin"); builder.sslEnabled(true).sslTruststoreFile(sslTrustStoreFile).sslTruststorePassword(sslTrustStorePin); + LOG.info("Configuring builder to enable SSL support"); } else { builder.sslEnabled(false); + LOG.info("Configuring builder to disable SSL support"); } String connectTimeoutString = couchbaseConnectionProperties.getProperty("connection.connect-timeout"); if (StringHelper.isNotEmpty(connectTimeoutString)) { int connectTimeout = Integer.valueOf(connectTimeoutString); builder.connectTimeout(connectTimeout); + LOG.info("Configuring builder to override connectTimeout from properties"); } String operationTracingEnabledString = couchbaseConnectionProperties.getProperty("connection.operation-tracing-enabled"); if (StringHelper.isNotEmpty(operationTracingEnabledString)) { boolean operationTracingEnabled = Boolean.valueOf(operationTracingEnabledString); builder.operationTracingEnabled(operationTracingEnabled); + LOG.info("Configuring builder to override operationTracingEnabled from properties"); } String mutationTokensEnabledString = couchbaseConnectionProperties.getProperty("connection.mutation-tokens-enabled"); if (StringHelper.isNotEmpty(mutationTokensEnabledString)) { boolean mutationTokensEnabled = Boolean.valueOf(mutationTokensEnabledString); builder.mutationTokensEnabled(mutationTokensEnabled); + LOG.info("Configuring builder to override mutationTokensEnabled from properties"); } String computationPoolSizeString = couchbaseConnectionProperties.getProperty("connection.computation-pool-size"); if (StringHelper.isNotEmpty(computationPoolSizeString)) { int computationPoolSize = Integer.valueOf(computationPoolSizeString); builder.computationPoolSize(computationPoolSize); + LOG.info("Configuring builder to override computationPoolSize from properties"); + } + + String keepAliveTimeoutString = couchbaseConnectionProperties.getProperty("connection.keep-alive-timeout"); + if (StringHelper.isNotEmpty(keepAliveTimeoutString)) { + long keepAliveTimeout = Integer.valueOf(keepAliveTimeoutString); + builder.keepAliveTimeout(keepAliveTimeout); + LOG.info("Configuring builder to override keepAliveTimeout from properties"); + } + + String keepAliveIntervalString = couchbaseConnectionProperties.getProperty("connection.keep-alive-interval"); + if (StringHelper.isNotEmpty(keepAliveIntervalString)) { + long keepAliveInterval = Integer.valueOf(keepAliveIntervalString); + builder.keepAliveInterval(keepAliveInterval); + LOG.info("Configuring builder to override keepAliveInterval from properties"); } this.couchbaseEnvironment = builder.build();