I've been searching in the docs of infinispan but couldn't find out an easy way to refresh the expiration time of an entry after a get automatically.
Today I'm registering a Listener and, inside the @CacheEntryVisited event, I remove and put it inside again, but it is, of course, not ideal.
@CacheEntryVisited
public void entryVisited(CacheEntryVisitedEvent<String, String> event) {
cache.remove(event.getKey);
cache.put(event.getKey(), event.getValue(), 10, TimeUnit.SECONDS);
}
There is some kind of config that can be used in CacheManager to make this refresh?
thanks in advance