File tree Expand file tree Collapse file tree 3 files changed +25
-24
lines changed
spring-boot-caching-2/src
spring-boot-caching/src/main/resources Expand file tree Collapse file tree 3 files changed +25
-24
lines changed Original file line number Diff line number Diff line change
1
+ <config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
2
+ xmlns =" http://www.ehcache.org/v3"
3
+ xmlns : jsr107 =" http://www.ehcache.org/v3/jsr107"
4
+ xsi : schemaLocation ="
5
+ http://www.ehcache.org/v3 http://www.ehcache.org/schema/ehcache-core-3.0.xsd
6
+ http://www.ehcache.org/v3/jsr107 http://www.ehcache.org/schema/ehcache-107-ext-3.0.xsd" >
7
+
8
+ <cache alias =" books" >
9
+ <key-type >java.lang.String</key-type >
10
+ <value-type >com.baeldung.springdatacaching.model.Book</value-type >
11
+ <expiry >
12
+ <ttl unit =" seconds" >30</ttl >
13
+ </expiry >
14
+
15
+ <resources >
16
+ <heap unit =" entries" >2</heap >
17
+ <offheap unit =" MB" >10</offheap >
18
+ </resources >
19
+ </cache >
20
+
21
+ </config >
Original file line number Diff line number Diff line change @@ -11,4 +11,7 @@ spring.jpa.show-sql=false
11
11
# Connection details
12
12
# spring.redis.host=localhost
13
13
# spring.redis.port=6379
14
- server.port =8000
14
+ server.port =8000
15
+
16
+ # ehcache
17
+ spring.cache.jcache.config =classpath:ehcache.xml
Original file line number Diff line number Diff line change 27
27
<offheap unit =" MB" >10</offheap >
28
28
</resources >
29
29
</cache >
30
-
31
- <cache alias =" books" >
32
- <key-type >java.lang.String</key-type >
33
- <value-type >com.baeldung.springdatacaching.model.Book</value-type >
34
- <expiry >
35
- <ttl unit =" seconds" >30</ttl >
36
- </expiry >
37
-
38
- <listeners >
39
- <listener >
40
- <class >com.baeldung.cachetest.config.CacheEventLogger</class >
41
- <event-firing-mode >ASYNCHRONOUS</event-firing-mode >
42
- <event-ordering-mode >UNORDERED</event-ordering-mode >
43
- <events-to-fire-on >CREATED</events-to-fire-on >
44
- <events-to-fire-on >EXPIRED</events-to-fire-on >
45
- </listener >
46
- </listeners >
47
-
48
- <resources >
49
- <heap unit =" entries" >2</heap >
50
- <offheap unit =" MB" >10</offheap >
51
- </resources >
52
- </cache >
53
30
54
31
</config >
You can’t perform that action at this time.
0 commit comments