Hi,
I am trying to use the CacheLoader mechanism, but unfortunately the cache remains empty after usage.
CacheLoader<String, String> loader;
loader = new CacheLoader<String, String>() {
@Nonnull
@Override
public String load(@Nonnull String s) {
LOGGER.debug("runner loader");
return "Test";
}
};
Cache<String, String> c;
c = this.cacheManager.getCache("demo.cache", loader, new CacheSettingsBuilder().expireAfterAccess(30, TimeUnit.MINUTES).build());
c.get("test1");
LOGGER.debug(c.getKeys().size())
Everytime the REST Endpoint gets executed, the loader runs and the returns the result. The cache size remains 0.
Best regards,
Alex