I am unable to properly connect to a Redis Instance on Elasticache with Encryption In-Transit enabled. I can connect to the redis client on the read. However on the write nothing happens, my job just hangs and eventually times out. The elasticache does not have any authentication. @mattusifer I saw that you wrote the code for SSL Context, if you could provide any insight that'd be great. Thanks!
object RedisClient {
var writeHost: String = "HOST"
var readHost: String = "HOST"
var port: Int = 6379
var keyTTL: Int = 3600
var maxIdle: Int = 8
var database: Int = 0
var secret: Option[Any] = None
var timeout: Int = 300000
var maxConnections: Int = RedisClientPool.UNLIMITED_CONNECTIONS
var poolWaitTimeout: Int = 3000
private val sslContext = SSLContext.getInstance("TLS")
private lazy val writePool = new RedisClientPool(writeHost, port, maxIdle, database, secret, timeout, maxConnections, poolWaitTimeout, Some(sslContext))
private lazy val readPool = new RedisClientPool(readHost, port, maxIdle, database, secret, timeout, maxConnections, poolWaitTimeout)
I am unable to properly connect to a Redis Instance on Elasticache with Encryption In-Transit enabled. I can connect to the redis client on the read. However on the write nothing happens, my job just hangs and eventually times out. The elasticache does not have any authentication. @mattusifer I saw that you wrote the code for SSL Context, if you could provide any insight that'd be great. Thanks!
object RedisClient { var writeHost: String = "HOST" var readHost: String = "HOST" var port: Int = 6379 var keyTTL: Int = 3600 var maxIdle: Int = 8 var database: Int = 0 var secret: Option[Any] = None var timeout: Int = 300000 var maxConnections: Int = RedisClientPool.UNLIMITED_CONNECTIONS var poolWaitTimeout: Int = 3000
private val sslContext = SSLContext.getInstance("TLS")
private lazy val writePool = new RedisClientPool(writeHost, port, maxIdle, database, secret, timeout, maxConnections, poolWaitTimeout, Some(sslContext)) private lazy val readPool = new RedisClientPool(readHost, port, maxIdle, database, secret, timeout, maxConnections, poolWaitTimeout)
def getCount(id: String): Option[String] = { readPool.withClient(client => { client.get(id) }) }
def setCount(id: String, count: String): Boolean = writePool.withClient(client => { client.setex(id, keyTTL, count) })
def close(): Unit = { readPool.close() writePool.close() } }