要让基于注释的缓存魔术与Spring一起工作,需要在xml中有一个声明,就像这样:<cache:annotation-driven />这就是我拥有的。我想去掉@ImportResource和XML文件。@ImportResource("classpath:cache-context.xml") * Create cache object for various cachable methods and add to EhC
org.springframework.boot.autoconfigure.SpringBootApplication;@SpringBootApplication public static void mainpackage org.springframework.cache.annotation does not exist
我正在使用@EnableCaching注解,但是如果redis宕机给了我BeanCreationException,那么我的服务器启动就会失败。因为无法处理BeanCreationException,所以我唯一的选择就是延迟加载我的@EnableCaching类。我尝试将这个类注释为下面的:@EnableCaching@Profile("dev")
public class RedisCache extends CachingConfigurerSupport
我试图通过@Cacheable注释将jpa实体缓存到redis。@Configuration @Value("${spring.redis.host}") private int port;
public RedisConnectionFactory redisConnectionFactory() {