Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@CollectionCacheable completely ignored #36

Open
Richie94 opened this issue Nov 9, 2022 · 4 comments
Open

@CollectionCacheable completely ignored #36

Richie94 opened this issue Nov 9, 2022 · 4 comments

Comments

@Richie94
Copy link

Richie94 commented Nov 9, 2022

Hey there,

I just try to get it run with your annotation, but it seems like this annotation gets completely ignored. I have @EnableCaching and also my @Cacheable annotations work like expected, but not the CollectionCacheable.

Im using Spring 2.7.5 and Kotlin, but also tried makeing a class with java where it also did not work. I see, that the CollectionCacheableCacheInterceptor gets called in the debug mode, but never checks my annotation.

Also I have the question as I where not able to test it, if it is intended that multiple calls to en empty findAll() Method would use the cache. So that first call sees its empty, so Im putting all with their key inside and second call just gets all the entries from a cache and returns it.

@neiser
Copy link
Collaborator

neiser commented Nov 9, 2022

Hi @Richie94

I've merged the Spring Boot 2.7.5 only in 1.3.1-SNAPSHOT so far, and at least the integration tests there ran fine in the Github Action. Are the examples from the README working for you? Can you come up with a minimal reproducer for the problem you're experiencing? Either as a standalone project or (preferred) as a failing test case (you may add one there via pull request)?

Regarding findAll: The README says that the return value, being a Map, puts all the returned entries into the cache using the key of the map as the cache key. This essentially fills the whole cache and subsequent findById calls are then already cached. Another call to findAll will just update the cache then (cache invalidation is out of scope here, and is usually achieved by TTLs).

@Richie94
Copy link
Author

Okay, thanks, than its not exactly what we are looking for. We aim for a mechanism on how to cache findAll so that we can have the cached result on the second call, but also using CachePut and CacheEvict only for some specific ids, which then should ideally be replaced/evicted also in the findAll Cacheable...

@kwhitejr
Copy link

I think I have a similar issue. After upgrading a Spring Boot app to spring-boot:3.0.2, the @CollectionCacheable annotation is seemingly ignored by the running application. Still fact-finding, but was wondering if you have plans to support.

@neiser
Copy link
Collaborator

neiser commented Feb 15, 2023

@kwhitejr Spring Boot 3.x is currently not supported. Happy to accept PRs though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants