1. What version of Ehcache you are currently using;
I am using Ehcache version: 3.2.1
2. Paste the configuration for the Cache/CacheManager you have an issue with;
<?xml version="1.0" encoding="UTF-8"?>
updateCheck="true" monitoring="autodetect" dynamicConfig="true">
<defaultCache maxElementsInMemory="10000" eternal="true"
overflowToDisk="false" maxElementsOnDisk="0" diskPersistent="false"
diskExpiryThreadIntervalSeconds="0" memoryStoreEvictionPolicy="FIFO" />
<cache name="MyCache" maxElementsInMemory="10000"
eternal="false" overflowToDisk="true" maxElementsOnDisk="15000"
diskPersistent="true" memoryStoreEvictionPolicy="LRU" />
</ehcache>
3. Add any name and version of other library or framework you use Ehcache with (e.g. Hibernate);
I am using Spring boot framework.
4. Providing JDK and OS versions maybe useful as well.
I am developing my application in Java 8 on windows (PRODUCTION will be on RHEL).
Below are my requirements:
1. I would like to load the entire cache at the application startup (data is from a select query on a database table).
2. For client requests, always read data from cache.
3. Read data based on different keys (for example, I have list of addresses cached, I need to fetch address based on Id, zip code, city, etc.).
4. Need to set the cache expiry so that it gets refreshed at a configured interval.
5. Persist data in the disk and read this during the application startup only if database query fails during startup.
Can I achieve above requirements using Ehcache in my spring boot application?
Appreciate any insights.
Thank you!
Rohit