1

I have a SpringBoot app with a customized Caffeine cache. Specifically, this cache implements com.github.benmanes.caffeine.cache.CacheWriter to do some post processing after an item is added or removed to the cache. However, the CacheWriter class was removed in Caffeine 3.X with the recommendation to

Consider instead using Map compute methods for extending manual write and remove operations.

I have not found any examples on doing this properly. Has anyone managed to get it working successfully please?

Samantha Catania
  • 5,116
  • 5
  • 39
  • 69
  • The intent was to avoid some confusion and to be closer to how you would do the same work using a `ConcurrentHashMap` which is a compute method. Spring Cache that does make it less obvious as you have to program to their apis, where I suspect maybe Spring events would be their intended approach (but am not familiar). – Ben Manes Mar 03 '23 at 08:46

0 Answers0