Questions tagged [caffeine-cache]

A high-performance in-memory cache for Java and other JVM languages.

Caffeine is a cache library with near-optimal performance; flexible configuration; blocking and non-blocking APIs; and integration points for external persistence, monitoring, and plug-in operation with many popular frameworks.

128 questions
0
votes
0 answers

Apache Camel components: jcache vs ehcache vs caffeine-cache

What is the main difference between jcache-component, ehcache-component and caffeine-cache-component (or any other); and which one would be the most appropriate for a simple use case in Apache Camel? The problem: I need to read a relatively large…
lcnicolau
  • 3,252
  • 4
  • 36
  • 53
0
votes
0 answers

Caffeine cache secondary indexing equivalent options

I am using caffeine cache and base use case is simple key value lookup based on primary key of objects however the values are objects and can be looked in in multiple ways and often resulting a list, So there are few questions that i have on this…
Mark1234
  • 589
  • 2
  • 8
  • 24
0
votes
1 answer

How to add a dynamic ttl on a per entry basis to Caffeine cache

I want to provide a method with the signature- `public void addObjectToCacheWithExpiry(CaffeineCacheManager caffeineCacheManager, String cacheName, String key, Object value, long duration, TimeUnit timeUnit)` So that I can put a value inside the…
xyz
  • 1
  • 1
0
votes
0 answers

The CGLIB enhancement can not work after I introduce the spring-boot-starter-data-jpa

The @Cacheable and @CachePut annotation works well before I introduce the spring-boot-starter-data-jpa. It is the bean with @Cacheable and @CachePut annotation: @Service public class BasicAuthRestTemplate { @Cacheable(value = "restTemplate",…
0
votes
0 answers

How to specify Expiry in Caffeine Cache but only for most recent instance of a given key / value mapping

I have a Caffeine Cache of String id and LocalDateTime (when record was inserted) I am trying to follow the principle of implementing expiry interface in order to manage expiry times A code snippet i took from stackoverflow is…
Biscuit128
  • 5,218
  • 22
  • 89
  • 149
0
votes
3 answers

Class cast exception during caffeine cache access

When I execute following code AppConfigurationCacheService appCache = getAppContext().getBean("appConfigurationCacheService"); appCache.getAppConfig("LANDING_PAGE"); I get a following exception: java.lang.String cannot be cast to…
T.J
  • 3
  • 3
0
votes
0 answers

Caffeine cache - custom eviction handling based on compositeCacheKey

I have following cache structure where cache key is composite key usecase_actualKey. Is it possible to write a custom eviction policy that keep only x entries for useCaseA_* and y entries of useCaseB_* myTestCache = { useCaseA_someKey1 :…
Jeya Kumar
  • 1,002
  • 1
  • 13
  • 36
0
votes
0 answers

Java in memory Caching library that support methods with element level ttl

I would like to set the expiry time of a member of an cache. I want the custom ttl when the object should expire. I know I can set it for the whole cache, e.g. Cache cache = manager.getCache("MyCache"); CacheConfiguration config =…
0
votes
0 answers

Java using coffeine library

I try to debug the caffeine cache, after adding a value to the cache I tried to get it as a map, invoking the asMap() method, but I never received a value, IntelliJ idea show me the message "Collecting data". I can't figure out what is wrong and…
user12420288
0
votes
0 answers

SOLR directory failed to be deleted after switch form LRUCache to CaffeineCache

// May be the technical input of this is lacking of details (I know), but that is everything I can see. My project is using SOLR for indexing. The app is being deployed in a K8s cluster, the solr data directory is mounted to an external directory,…
Andiana
  • 1,912
  • 5
  • 37
  • 73
0
votes
1 answer

How to enable specific cache names and disable other name using Caffeine cache in Spring boot application

I am using Spring Boot for my application. Using @EnableCaching annotation at application level. Consider I have multiple cache names like below in some methods on the application @Cacheable(value = "cache1") @Cacheable(value =…
Galet
  • 5,853
  • 21
  • 82
  • 148
0
votes
1 answer

ExpireAfterRead/Write/Update support in redis clients

Does any of the java redis clients support the above primitives in their api for TTL? I am using redisson currently. This is supported by the in-memory cache lib like caffeine.
0
votes
0 answers

Springboot, Caffeine and bucket4j Integration with individual expiry for each cache

I have created a Springboot app and have implemented in-memory Cache & throttling using Caffeine and bucket4j. application.yml spring: cache: jcache: provider: com.github.benmanes.caffeine.jcache.spi.CaffeineCachingProvider …
Andy
  • 5,433
  • 6
  • 31
  • 38
0
votes
0 answers

caffeine cache - Limit size to x MB

Is it possible to set caffeine cache size limited to x MB ? If this is not possible, is there any performance reason for not doing it [For my understanding]. I checked with weighter, . As per my understanding weight is calculated based on number of…
Jeya Kumar
  • 1,002
  • 1
  • 13
  • 36
0
votes
2 answers

How to cache exceptions using spring boot cache and caffeine

Very simple and straight forward exception. is there any way to cache exception using caffeine/springboot ? some specific exceptions in my method can be very time consuming... [404 for example] i wish i could cache it and avoid long processing
Rafael Lima
  • 3,079
  • 3
  • 41
  • 105
1 2 3
8 9