I'm setting up a Redis cache layer using AWS Elasticache Redis version 7.0.7
I'm usign Java Redisson client version 3.16.0 and java version 1.8
However one of the requirement is to setup a fallback mechanism to fallback to the downstream service or database method whenever there is any exception on Redis operation
Below is my Redisson client configurations
redissonConfig.setNettyThreads(128);
redissonConfig.useClusterServers()
.setKeepAlive(true)
.setConnectTimeout(5000)
.setRetryAttempts(0)
.setRetryInterval(0)
.setPingConnectionInterval(10000)
.setDnsMonitoringInterval(20000)
.addNodeAddress(redisAddress);
RedissonClient client = Redisson.create(redissonConfig);
return client;
However I'm getting below intermittent exceptions on read/write and on evict Redis operations
1-Read write operation Exceptions:
exception: org.redisson.client.RedisTimeoutException: Command still hasn't been written into connection! Try to increase nettyThreads setting. Payload size in bytes: 52. Node source: NodeSource [slot=8995, addr=null, redisClient=null, redirect=null, entry=null], connection: RedisConnection@573846890 [redisClient=[addr=rediss://xxxxx:6379], channel=[id: 0x93e5c3e6, L:/:38098 - R:xxx], currentCommand=null], command: (EVAL), params: [local value = redis.call('hget', KEYS[1], ARGV[2]); if value == false then return nil; end; local t,..., 5, data, redisson__timeout__set:{data}, redisson__idle__set:{data}, redisson__map_cache__last_access__set:{data}, {data}:redisson_options, 1684331276823, PooledUnsafeDirectByteBuf(ridx: 0, widx: 52, cap: 256)] after 0 retry attempts
2- Exceptions when Redisson job try to evict the cache, I’m resolving this by doing manual eviction through redis-cli
exception: org.redisson.client.RedisException: ERR user_script:1: bad argument #2 to 'unpack' (data string too short) script: 401d7fca9b4e9022dffaa4fd236958c2babbc2f3, on @user_script:1.. channel: [id: 0x064bccc5
Appreciate if you have any recommendation to prevent such issues.
Note: the fallback mechanism is working as expected.
Thanks