SpringBoot-Redis使用

版权声明:本文为博主原创文章,转载请注明出处。 https://blog.csdn.net/qq_15764943/article/details/85039036

SpringBoot-Redis简单使用

添加依赖

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-redis</artifactId>
</dependency>

添加配置文件

spring.redis.host=127.0.0.1
spring.redis.port=6379
spring.redis.pool.max-active=5   #最大连接池

代码中使用

@Autowired
private StringRedisTemplate redisTemplate;

猜你喜欢

转载自blog.csdn.net/qq_15764943/article/details/85039036
今日推荐