You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the following code to set up a memcached client to connect to a multi-node elasticache cluster. The URL_PROPERTY is set to a configure url which contains ".cfg." I explicitly set the client mode to 'Unset' which based on MemcachedClient.java looks like it should trigger the determineClientMode logic. But for some reason it doesn't and the client always ends up set to Static mode and only uses a single node in the cluster. If I instead explicitly set the connection factory client mode to Dynamic it works as expected and correctly detects and uses all nodes in the cluster.
ConnectionFactoryBuilder connectionFactoryBuilder = new ConnectionFactoryBuilder(new KetamaConnectionFactory());
if (Boolean.parseBoolean(RuntimeProperties.getProperty(CACHE_PROVIDER_MEMCACHED_USE_SSL_PROPERTY))) {
// Build SSLContext
TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
tmf.init((KeyStore)null);
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(null, tmf.getTrustManagers(), null);
// Create the client in TLS mode
connectionFactoryBuilder.setSSLContext(sslContext);
connectionFactoryBuilder.setSkipTlsHostnameVerification(true);
}
connectionFactoryBuilder.setClientMode(ClientMode.Unset);
cache = new MemcachedClient(connectionFactoryBuilder.build(), AddrUtil.getAddresses(
RuntimeProperties.getProperty(CACHE_PROVIDER_MEMCACHED_URL_PROPERTY)));
The text was updated successfully, but these errors were encountered:
I'm using the following code to set up a memcached client to connect to a multi-node elasticache cluster. The URL_PROPERTY is set to a configure url which contains ".cfg." I explicitly set the client mode to 'Unset' which based on MemcachedClient.java looks like it should trigger the determineClientMode logic. But for some reason it doesn't and the client always ends up set to Static mode and only uses a single node in the cluster. If I instead explicitly set the connection factory client mode to Dynamic it works as expected and correctly detects and uses all nodes in the cluster.
The text was updated successfully, but these errors were encountered: