我正在使用Spring Boot,并且使用Ehcache进行缓存。目前为止一切正常。但是现在我需要重新加载/刷新,那么我该怎么做才能使我的应用程序没有任何停机时间。
我已经尝试了Spring Ehcache中的许多方法,但它们都没有奏效。或者我必须编写一个调度程序来重新加载数据。
@Override
@Cacheable(value="partTypeCache", key="#partKey")
public List<PartType> loadPartType(String partKey) throws CustomException {
return productIdentityDao.loadPartType();
}