Skip to content

Commit fb55493

Browse files
committed
Spring Boot 2.x基础教程:使用集中式缓存Redis
1 parent 3147a0f commit fb55493

File tree

5 files changed

+11
-1
lines changed

5 files changed

+11
-1
lines changed

2.1.x/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
- [Spring Boot 2.x基础教程:进程内缓存的使用与Cache注解详解](http://blog.didispace.com/spring-boot-learning-21-5-1/)
9797
- [Spring Boot 2.x基础教程:EhCache缓存的使用](http://blog.didispace.com/spring-boot-learning-21-5-2/)
9898
- [Spring Boot 2.x基础教程:使用EhCache缓存集群](http://blog.didispace.com/spring-boot-learning-21-5-3/)
99+
- [Spring Boot 2.x基础教程:使用集中式缓存Redis](http://blog.didispace.com/spring-boot-learning-21-5-4/))
99100

100101
### Web开发
101102

2.1.x/README_zh.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@
9191
- [Spring Boot 2.x基础教程:进程内缓存的使用与Cache注解详解](http://blog.didispace.com/spring-boot-learning-21-5-1/)
9292
- [Spring Boot 2.x基础教程:EhCache缓存的使用](http://blog.didispace.com/spring-boot-learning-21-5-2/)
9393
- [Spring Boot 2.x基础教程:使用EhCache缓存集群](http://blog.didispace.com/spring-boot-learning-21-5-3/)
94+
- [Spring Boot 2.x基础教程:使用集中式缓存Redis](http://blog.didispace.com/spring-boot-learning-21-5-4/))
9495

9596
### Web开发
9697

2.1.x/chapter5-4/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434
<artifactId>spring-boot-starter-data-redis</artifactId>
3535
</dependency>
3636

37+
<dependency>
38+
<groupId>org.apache.commons</groupId>
39+
<artifactId>commons-pool2</artifactId>
40+
</dependency>
41+
3742
<dependency>
3843
<groupId>org.springframework.boot</groupId>
3944
<artifactId>spring-boot-starter-actuator</artifactId>

2.1.x/chapter5-4/src/main/resources/application.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
spring.datasource.url=jdbc:mysql://localhost:3306/test
22
spring.datasource.username=root
3-
spring.datasource.password=
3+
spring.datasource.password=12345678
44
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
55

6+
spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect
67
spring.jpa.show-sql=true
78
spring.jpa.hibernate.ddl-auto=create-drop
89

2.1.x/chapter5-4/src/test/java/com/didispace/chapter54/Chapter54ApplicationTests.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ public class Chapter54ApplicationTests {
2121

2222
@Test
2323
public void test() throws Exception {
24+
System.out.println("CacheManager type : " + cacheManager.getClass());
25+
2426
// 创建1条记录
2527
userRepository.save(new User("AAA", 10));
2628

0 commit comments

Comments
 (0)