Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2222

Redisson Cache Map does not evict if process is terminated

$
0
0

I am using Redisson's RMapCache to handle some distributed collections in my application.

The keys in these collections, should expire after some time, so when adding keys I set the TTL:

RMapCache<String, MyClass> cacheMap = GetMap("test");cacheMap.put("DTO1", myClassInstance, 20, TimeUnit.SECONDS);

So after 20 seconds the Key should expire. This works perfectly, if the process is not terminated before the expiration timestamp. However, if for any reason the process dies, then the key is never cleared, which means that the eviction is handled by Redisson within the Java process and not by Redis itself.

Is there any way to make redisson use the Redis' built-in EXPIRE feature? So that the process that inserts in the Map is not responsible for the keys eviction.

I find the current redisson implementation to be extremely fragile.


Viewing all articles
Browse latest Browse all 2222


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>