Skip to content
Advertisement

Tag: ttl

Collection Object lost due to redis TTL using redission client

We are using Redission client for java to get the data from redis but object gets deleted from collection due to TTL. Example We are trying the below approach to get the data from Redis with TTL. final RList rList = client.getList(getEnvCacheKey(cacheKey)); rList.expire(7L, TimeUnit.SECONDS); rlist.add(“Value1”); rlist.add(“Value2”); assertThat(rList).containsOnly(“Value1”, “Value2”); // This condition is true until 7 seconds Now after 7 seconds

Advertisement