From fc38c1ba4d242ee1bfdb44b85c84e53276632d3d Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Wed, 7 Jun 2017 18:41:38 +0300 Subject: [PATCH] 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 --- spring-boot-samples/spring-boot-sample-cache/README.adoc | 5 ++--- .../src/main/resources/application.properties | 6 +++--- .../src/main/resources/infinispan.xml | 5 +++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/spring-boot-samples/spring-boot-sample-cache/README.adoc b/spring-boot-samples/spring-boot-sample-cache/README.adoc index 25284b0902..7be6abf504 100644 --- a/spring-boot-samples/spring-boot-sample-cache/README.adoc +++ b/spring-boot-samples/spring-boot-sample-cache/README.adoc @@ -85,9 +85,8 @@ TIP: Run sample cache application using Hazelcast with === Infinispan Add the `org.infinispan:infinispan-spring4-embedded` dependency to enable support for Infinispan. There is no default location that Infinispan uses to look for a config -file so if you don't specify anything it will bootstrap on a hardcoded default. You -can set the `spring.cache.infinispan.config` property to use the provided -`infinispan.xml` configuration instead. +file so this sample is configured to use a the provider `infinispan.xml` configuration +file specified via the `spring.cache.infinispan.config` property. TIP: Run sample cache application using Infinispan with `$mvn spring-boot:run -Pinfinispan`. diff --git a/spring-boot-samples/spring-boot-sample-cache/src/main/resources/application.properties b/spring-boot-samples/spring-boot-sample-cache/src/main/resources/application.properties index d4bfa887c9..d1636539a3 100644 --- a/spring-boot-samples/spring-boot-sample-cache/src/main/resources/application.properties +++ b/spring-boot-samples/spring-boot-sample-cache/src/main/resources/application.properties @@ -3,7 +3,7 @@ management.security.enabled=false # # Infinispan configuration file location. # -#spring.cache.infinispan.config=infinispan.xml +spring.cache.infinispan.config=infinispan.xml # @@ -15,10 +15,10 @@ management.security.enabled=false # # Caffeine configuration # -#spring.cache.caffeine.spec=maximumSize=200,expireAfterAccess=600s +spring.cache.caffeine.spec=maximumSize=200,expireAfterAccess=600s # # Guava configuration # -#spring.cache.guava.spec=maximumSize=200,expireAfterAccess=600s +spring.cache.guava.spec=maximumSize=200,expireAfterAccess=600s diff --git a/spring-boot-samples/spring-boot-sample-cache/src/main/resources/infinispan.xml b/spring-boot-samples/spring-boot-sample-cache/src/main/resources/infinispan.xml index 0dc58a3b48..c2c980791d 100644 --- a/spring-boot-samples/spring-boot-sample-cache/src/main/resources/infinispan.xml +++ b/spring-boot-samples/spring-boot-sample-cache/src/main/resources/infinispan.xml @@ -1,8 +1,9 @@ - + - + +