Questions tagged [jsr107]

JSR 107: JCACHE - Java Temporary Caching API

More details on Spring

33 questions
14
votes
2 answers

Using ehcache 3 with Spring Annotations (not using Spring Boot)

I'm trying to get Ehcache 3 working with Spring 4 without using Spring boot. Here is a working example out there which uses Spring Boot, but I'm working on an existing application which is not using Spring Boot. The problem is that…
Håvard Geithus
  • 5,544
  • 7
  • 36
  • 51
6
votes
2 answers

Spring cache/jsr107: list/collection argument as part of the key

I have a service which calls external system to retrieve some kind of objects by their external id as well as submit them back to update. Rather than retrieving objects one by one there is a more generic purpose methods: public interface…
Vadim Kirilchuk
  • 3,532
  • 4
  • 32
  • 49
5
votes
1 answer

JCache with multiple caching providers?

I intentionally have a couple of different caching providers in my classpath. I have Hazelcast for distributed cache and Caffeine for a local cache. I am trying to use JCache (JSR107) annotations for caching my values. I have already created a…
Eric B.
  • 23,425
  • 50
  • 169
  • 316
4
votes
1 answer

Easiest way to connect Hazelcast JCache implementation to JSR107 annotations

Hazelcast is - among other things - an implementation for JCache. The JSR-107 (JCache) specification, along with a programmatic API also specifies annotations, so that caching can be done using CDI. The Hazelcast Blog even gives an example, but also…
Jan Dörrenhaus
  • 6,581
  • 2
  • 34
  • 45
3
votes
1 answer

Springboot and Ehcache - MultiCacheException

I'm trying to add caching to a springboot application and I am running into an issue where a org.ehcache.jsr107.MultiCacheException exception is being thrown during startup. I am using the following ( all loaded via Maven pom file): Springboot…
Brad
  • 121
  • 1
  • 5
3
votes
1 answer

Disable / Switch off Ehcache3

Anybody knows how to switch off ehcache 3 in an application? (e.g. for testing purposes or fall back scenarios in production) For ehcache 2 this was possible with: net.sf.ehcache.disabled=true as described here How to disable all caches in ehcache3…
timguy
  • 2,063
  • 2
  • 21
  • 40
2
votes
1 answer

JCache key exception

I have a method that has to be cached. I have a SpringBoot 2.1.7 application with a JSR-107 (JCache) cache. Cache implementation used: EHCache 3.8.0. @Override @HystrixCommand(fallbackMethod = "fallbackGetAllUserProfiles") @Timed(histogram = true,…
Sven
  • 2,343
  • 1
  • 18
  • 29
2
votes
1 answer

Redisson (through JCache API) deserialising only to String

I have a Redisson client to store a pair String, LocalDateTime. It's configured to be used through the JCache API (JSR-107). The storage is done OK, converting with Jackson to values like 2018-01-23T11:59:34.997834 but for retrieval is not using any…
Pedro R.
  • 142
  • 1
  • 11
2
votes
1 answer

EhCache cached object modification

I've to implement caching with EhCache. Basic requirement is, I have to keep that cached object for fixed interval ( for now 1 hours in code below). So, I implemented the code as below: Sample domain object: import…
Yogen Rai
  • 2,961
  • 3
  • 25
  • 37
1
vote
2 answers

Ehcache integration in Spring Boot application fails

I try to integrate Ehcache 3 into a Spring Boot 2.7.7 application, but during startup, the application fails with the following error message: org.springframework.beans.factory.BeanCreationException: Error creating bean with name…
Oliver
  • 3,815
  • 8
  • 35
  • 63
1
vote
0 answers

Hystrix javanica cache and JCache

I have a SpringBoot (2.1.7) application with Hystrix (Javanica) and JCache (EHCache implementation). I have methods annotated with the @HystrixCommand annotation to enable Hystrix for them. I also have caching on those methods. It looks like…
Sven
  • 2,343
  • 1
  • 18
  • 29
1
vote
1 answer

Is there a way to modify a JCache's expiry policy that has been declared declaratively?

I'm using Hazelcast 3.12 jCache implementation. My cache has been declared declaratively (via hazelcast-config.xml), however I want to be able to change the ExpiryPolicy's duration dynamically, as the timeout value is only available…
Eric B.
  • 23,425
  • 50
  • 169
  • 316
1
vote
1 answer

Anyway to view Cache entry metadata from Hazelcast (ie: date added, last accessed, etc)?

I'm using Hazelcast with a distributed cache in embedded mode. My cache is defined with an Eviction Policy and an Expiry Policy. CacheSimpleConfig cacheSimpleConfig = new CacheSimpleConfig() .setName(CACHE_NAME) …
Eric B.
  • 23,425
  • 50
  • 169
  • 316
1
vote
1 answer

Spring JCache logging cache hits

I have a method on which I added a cache by adding the @CacheResult annotation (I actual created a proxy because I can't change the original implementation of SomethingService): @Service public class SomethingServiceProxyImpl implements…
1
vote
1 answer

Eviction Event Listeners for Caffeine or any JVM Cache API?

Java 8 here. Is there any way with the Caffeine caching framework (or any other JSR-107 compatible framework for that matter) to be notified when a record is evicted out of the cache? Maybe some kind of EvictionEventListener or something? public…
hotmeatballsoup
  • 385
  • 6
  • 58
  • 136
1
2 3