我想自己在spring-boot和impl缓存中使用cacable,我希望它在服务器中运行时可以更新,因此我在Configuration类中对其进行了配置,当我不对其进行自动接线时,它可以很好地工作,当我在带有注释注解的CachingConfigurerSupport bean中自动连线并通过Spring Cloud Bus刷新它以更新配置时,它不起作用
@Configuration
@ConfigurationProperties(prefix = "service.cache.redis")
public class CacheConfig {
private string redisHost;
private string redisPort;
private string redisPwd;
private Jedis jedis;
@PostConstruct
void init() {
//do for build jedis
}
}
@Component
@EnableCaching
public class CachableSupport extends CachingConfigurerSupport {
@Autowired
CacheConfig CacheConfig;
@Override
public CacheManager cacheManager() {
return new CacheManagerImpl(CacheConfig);
}
@Override
public KeyGenerator keyGenerator() {
return null;
}
@Override
public CacheResolver cacheResolver() {
return null;
}
@Override
public CacheErrorHandler errorHandler() {
return null;
}
}