首页 > 解决方案 > 如何将值从 application.yml 获取到 ehcache.xml?

问题描述

我在 application.yml 中有
TTL 值我想在 ehcache.xml 中使用 application.yml 中的这个 TTL 值
如何调用 application.yml 值

application.yml

    reset:
      servicebus:
        system-name: ${ECP_CACHE_RESET_CONSUMER_NAME:}
        notification-base-url: ${ECP_CACHE_RESET_BASEURL:}
        topic-name: ${ECP_CACHE_RESET_TOPIC:}
        cache-reset-time: 10000

ehcache.xml

<cache name="refDataCache" maxElementsInMemory="15000"
           maxEntriesLocalDisk="20000" eternal="false"
           timeToIdleSeconds="300" timeToLiveSeconds="720000" overflowToDisk="true"
           memoryStoreEvictionPolicy="LFU" />

我想在 timeToLiveSeconds 中使用这个 ecache.xml 中的这个缓存重置时间值

标签: javaxmlspring-bootyaml

解决方案


推荐阅读