Skip to content

Instantly share code, notes, and snippets.

@Romeh

Romeh/ehcache.xml

Created Dec 22, 2017
Embed
What would you like to do?
<config
xmlns:jsr107='http://www.ehcache.org/v3/jsr107'
xmlns='http://www.ehcache.org/v3'>
<service>
<jsr107:defaults enable-management="true" enable-statistics="true"/>
</service>
<!-- file persistance enabling-->
<persistence directory="./cache"></persistence>
<!-- the 2 caches we will create-->
<cache alias="AlertsConfig" uses-template="config-cache"/>
<cache alias="Alerts" uses-template="alerts-template"/>
<!-- the config cache tenplate-->
<cache-template name="config-cache">
<listeners>
<listener>
<!-- the the main cache event listener-->
<class>com.demo.alertmanager.services.CacheEventLogger</class>
<event-firing-mode>ASYNCHRONOUS</event-firing-mode>
<event-ordering-mode>UNORDERED</event-ordering-mode>
<events-to-fire-on>CREATED</events-to-fire-on>
<events-to-fire-on>UPDATED</events-to-fire-on>
<events-to-fire-on>EXPIRED</events-to-fire-on>
<events-to-fire-on>REMOVED</events-to-fire-on>
<events-to-fire-on>EVICTED</events-to-fire-on>
</listener>
</listeners>
<resources>
<heap>1</heap>
<offheap unit="MB">1</offheap>
<disk persistent="true" unit="MB">100</disk>
</resources>
</cache-template>
<cache-template name="alerts-template">
<listeners>
<listener>
<class>com.demo.alertmanager.services.CacheEventLogger</class>
<event-firing-mode>ASYNCHRONOUS</event-firing-mode>
<event-ordering-mode>UNORDERED</event-ordering-mode>
<events-to-fire-on>CREATED</events-to-fire-on>
<events-to-fire-on>UPDATED</events-to-fire-on>
<events-to-fire-on>EXPIRED</events-to-fire-on>
<events-to-fire-on>REMOVED</events-to-fire-on>
<events-to-fire-on>EVICTED</events-to-fire-on>
</listener>
</listeners>
<resources>
<heap>1</heap>
<offheap unit="MB">1</offheap>
<disk persistent="true" unit="MB">100</disk>
</resources>
</cache-template>
</config>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment