Skip to content

Commit fc38c1b

Browse files
committed
Improve cache sample
Clarify the cache sample and in particular that Infinispan does not bootstrap with a default configuration file. Hence the custom `infinispan.xml` configuration is enabled by default if Infinispan is available on the classpath. See gh-9417
1 parent 9579e95 commit fc38c1b

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

spring-boot-samples/spring-boot-sample-cache/README.adoc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,8 @@ TIP: Run sample cache application using Hazelcast with
8585
=== Infinispan
8686
Add the `org.infinispan:infinispan-spring4-embedded` dependency to enable support for
8787
Infinispan. There is no default location that Infinispan uses to look for a config
88-
file so if you don't specify anything it will bootstrap on a hardcoded default. You
89-
can set the `spring.cache.infinispan.config` property to use the provided
90-
`infinispan.xml` configuration instead.
88+
file so this sample is configured to use a the provider `infinispan.xml` configuration
89+
file specified via the `spring.cache.infinispan.config` property.
9190

9291
TIP: Run sample cache application using Infinispan with
9392
`$mvn spring-boot:run -Pinfinispan`.

spring-boot-samples/spring-boot-sample-cache/src/main/resources/application.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ management.security.enabled=false
33
#
44
# Infinispan configuration file location.
55
#
6-
#spring.cache.infinispan.config=infinispan.xml
6+
spring.cache.infinispan.config=infinispan.xml
77

88

99
#
@@ -15,10 +15,10 @@ management.security.enabled=false
1515
#
1616
# Caffeine configuration
1717
#
18-
#spring.cache.caffeine.spec=maximumSize=200,expireAfterAccess=600s
18+
spring.cache.caffeine.spec=maximumSize=200,expireAfterAccess=600s
1919

2020

2121
#
2222
# Guava configuration
2323
#
24-
#spring.cache.guava.spec=maximumSize=200,expireAfterAccess=600s
24+
spring.cache.guava.spec=maximumSize=200,expireAfterAccess=600s

spring-boot-samples/spring-boot-sample-cache/src/main/resources/infinispan.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<infinispan xmlns="urn:infinispan:config:7.2">
2+
<infinispan xmlns="urn:infinispan:config:8.2">
33

44
<cache-container default-cache="default">
5-
<local-cache name="countries" statistics="true">
5+
<local-cache name="default"/>
6+
<local-cache name="countries">
67
<eviction max-entries="200"/>
78
<expiration lifespan="600000"/>
89
</local-cache>

0 commit comments

Comments
 (0)