How can I parameterize ehcache.xml with properties loaded at runtime?

I am using Ehcache + Hibernate + Spring with the ehcache.xml file. I would like to parameterize ehcache.xml with the material from the properties file at runtime. Does anyone know an easy way to do this?

+4
source share
1 answer

It depends on what configuration you are talking about. ehcache.xml contains some global configuration (for example, the location of the disk overflow directory), as well as a cache-specific configuration.

If you're talking about the latter, you can use Spring EhCache support (i.e. EhCacheFactoryBean and EhCacheManagerFactoryBean ) to configure and manage EhCache instances.

If you are talking about global configuration, I do not know how to do this.

+2
source

Source: https://habr.com/ru/post/1334481/


All Articles