-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
72 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/main/java/de/caritas/cob/mailservice/api/cache/CacheEventLogger.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package de.caritas.cob.mailservice.api.cache; | ||
|
||
import lombok.extern.slf4j.Slf4j; | ||
import org.ehcache.event.CacheEvent; | ||
import org.ehcache.event.CacheEventListener; | ||
|
||
@Slf4j | ||
public class CacheEventLogger implements CacheEventListener<Object, Object> { | ||
|
||
@Override | ||
public void onEvent(CacheEvent<? extends Object, ? extends Object> cacheEvent) { | ||
log.info( | ||
"caching event: ", cacheEvent.getKey(), cacheEvent.getOldValue(), cacheEvent.getNewValue()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<config | ||
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' | ||
xmlns='http://www.ehcache.org/v3' | ||
xsi:schemaLocation=" | ||
http://www.ehcache.org/v3 | ||
http://www.ehcache.org/schema/ehcache-core-3.7.xsd"> | ||
|
||
<cache alias="translations"> | ||
<expiry> | ||
<ttl unit="seconds">60</ttl> | ||
</expiry> | ||
|
||
<resources> | ||
<offheap unit="MB">10</offheap> | ||
</resources> | ||
</cache> | ||
|
||
<cache-template name="default"> | ||
<expiry> | ||
<ttl unit="seconds">60</ttl> | ||
</expiry> | ||
<listeners> | ||
<listener> | ||
<class>de.caritas.cob.mailservice.api.cache.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>EXPIRED</events-to-fire-on> | ||
<events-to-fire-on>EVICTED</events-to-fire-on> | ||
</listener> | ||
</listeners> | ||
<resources> | ||
<heap>1000</heap> | ||
<offheap unit="MB">10</offheap> | ||
<disk persistent="true" unit="MB">20</disk> | ||
</resources> | ||
</cache-template> | ||
</config> |