-
Notifications
You must be signed in to change notification settings - Fork 794
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
1 parent
b1ac08e
commit 0a75094
Showing
7 changed files
with
56 additions
and
2 deletions.
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
12 changes: 12 additions & 0 deletions
12
src/main/java/guru/springframework/msscbeerservice/config/CacheConfig.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,12 @@ | ||
package guru.springframework.msscbeerservice.config; | ||
|
||
import org.springframework.cache.annotation.EnableCaching; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
/** | ||
* Created by jt on 2019-06-09. | ||
*/ | ||
@EnableCaching | ||
@Configuration | ||
public class CacheConfig { | ||
} |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
sfg.brewery.beer-inventory-service-host=http://localhost:8082 | ||
spring.datasource.initialization-mode=EMBEDDED | ||
spring.cache.jcache.config=classpath:ehcache.xml |
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,20 @@ | ||
<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> | ||
|
||
<cache alias="beerCache" uses-template="config-cache"/> | ||
<cache alias="beerListCache" uses-template="config-cache"/> | ||
|
||
<cache-template name="config-cache"> | ||
<expiry> | ||
<ttl unit="minutes">5</ttl> | ||
</expiry> | ||
<resources> | ||
<heap>1</heap> | ||
<offheap unit="MB">1</offheap> | ||
</resources> | ||
</cache-template> | ||
</config> |