BAEL-6250: refactor: Move to spring-caching-2 since spring-caching is full
This commit is contained in:
-25
@@ -1,25 +0,0 @@
|
||||
package com.baeldung.allkeys.config;
|
||||
|
||||
import org.springframework.cache.CacheManager;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.cache.caffeine.CaffeineCacheManager;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import com.baeldung.allkeys.service.SlowServiceWithCache;
|
||||
|
||||
@Configuration
|
||||
@EnableCaching
|
||||
public class AllKeysConfig {
|
||||
|
||||
@Bean
|
||||
SlowServiceWithCache slowServiceWithCache() {
|
||||
return new SlowServiceWithCache();
|
||||
}
|
||||
|
||||
@Bean
|
||||
CacheManager cacheManager() {
|
||||
return new CaffeineCacheManager();
|
||||
}
|
||||
|
||||
}
|
||||
-11
@@ -1,11 +0,0 @@
|
||||
package com.baeldung.allkeys.service;
|
||||
|
||||
import org.springframework.cache.annotation.CachePut;
|
||||
|
||||
public class SlowServiceWithCache {
|
||||
|
||||
@CachePut(cacheNames = "slowServiceCache", key = "#name")
|
||||
public String save(String name, String details) {
|
||||
return details;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user