根据的说法,在springboot中使用缓存的最简单配置是使用CacheManager (缓存映射将在此类中初始化):@EnableCaching ...但是它抛出了:
java.lang.IllegalStateException: No cache could be resolved for 'Builder但是bean中的所有方法都会被缓存
我希望我的springboot服务器启动,即使我的redis缓存没有启动。因为无法处理BeanCreationException,所以我唯一的选择就是延迟加载我的@EnableCaching类。我尝试将这个类注释为下面的:@EnableCaching@Profile("dev")
public class RedisCache extends CachingConfigurerSupport