docker重启后ehcache没有被清除

时间:2019-10-28 01:40:46

标签: spring-boot docker ehcache

请找到在Spring Boot中部署为Docker容器的 ehcache 配置。 jvm位于docker容器中。

<bean id="seedCache" class="org.springframework.cache.ehcache.EhCacheFactoryBean">
    <property name="cacheManager" ref="cacheManager"/>
    <property name="eternal" value="false"/>
    <property name="timeToIdleSeconds" value="${enricher.timeToIdleSeconds}"/>
    <property name="timeToLiveSeconds" value="${enricher.timeToLiveSeconds}"/> 
    <property name="disabled" value="${enricher.cache.disabled}"/>   
</bean>


  #Cache config
  enricher_cache_time_idle: 1800
  enricher_cache_ttl: 1800
  enricher_cache_disabled: false 

我假设docker的重启将清除其关联的缓存,因为“ eternal ”属性设置为false,即使ttl没有过期也是如此。

**注意:假设重新启动jvm会清除高速缓存,除非它不是永久高速缓存,因为高速缓存将序列化的对象存储在JVM堆上。但是我想这不是在码头工人的情况下!有人可以建议。

正在计划为此目的公开MBean。但是试图了解事物。预先感谢。

0 个答案:

没有答案