【发布时间】:2019-12-01 21:35:56
【问题描述】:
我有一个旧的 Spring Boot 应用程序(1.5.0-FINAL),我无法更改此版本。 我想将 redis 添加到我的应用程序中,这就是我所做的:
1) 添加了maven dep:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-redis</artifactId>
<version>1.5.10.RELEASE</version>
</dependency>
2) 将属性添加到我的引导中
@EnableCaching
public class MySpringBootApp{
3) 添加配置属性以检查是否启动连接:
spring.cache.type: redis
spring.redis.host: 192.168.99.100
spring.redis.port: 6379
上面的主机/端口不存在:我只想在启动时看到类似“连接错误”的信息,以确保我配置了所有内容但没有出现!看来spring boot只是不尝试使用缓存。
我错过了什么吗?也许我的 Spring Boot 版本太旧了?
【问题讨论】:
标签: spring-boot redis spring-data-redis