springboot 集成redis (单点)
来源:互联网 发布:线切割编程3b 编辑:程序博客网 时间:2024/06/15 05:40
最近做一些关于springboot方面的东西,刚好抽空准备集成一下关于redis的部分,但是看 了网上的很多教程,不过都不是很对。现在完整的教程下一下,以备以后查阅使用。
springboot是属于开箱即用的那种,对于redis的使用也是一样。下面开始讲怎么使用springboot集成redis。
项目是采用maven构建,以下是需要的jar包。
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-cache</artifactId></dependency><dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> <version>1.5.6.RELEASE</version></dependency>
然后在application.properties 中配置关于redis的项。
spring.redis.database=0spring.redis.host=192.168.29.128spring.redis.password=spring.redis.port=6379spring.redis.pool.max-idle=8spring.redis.pool.min-idle=0 spring.redis.pool.max-active=8 spring.redis.pool.max-wait=-1
只需要这样就可以完成springboot+redis的基本配置,在项目中可以通过注解的方式,将redisTemplate和stringRedisTemplate注入到MVC层中。通过提供的方法来完成对redis 的一些基本操作。
阅读全文
0 0
- springboot 集成redis (单点)
- 一步一步学springboot (九)集成redis
- SpringBoot -- 集成Redis/CacheManager
- SpringBoot -- 集成Redis/CacheManager
- springboot集成redis
- springboot集成Redis
- springboot 集成redis 哨兵
- springboot集成Redis
- SpringBoot集成Redis
- springboot集成redis详解
- 关于SpringBoot 集成 Redis
- SpringBoot集成Redis
- springboot集成redis
- SpringBoot集成Redis
- SpringBoot集成Redis
- 在SpringBoot中集成Redis
- SpringBoot 入门教程:集成mybatis,redis
- SpringBoot 入门教程:集成mybatis,redis
- what is paradiam shifting
- 新浪cloud之Git版本控制
- Android仿京东App购物车 二级列表+全选反选+Ok封装+拦截器+结算+商品数量计算
- 模板
- vfork的那些事情
- springboot 集成redis (单点)
- 数据结构实验之排序五:归并求逆序数
- C++_字符串_初探1
- system-api.txt:27075: error 13 has added 'final' qualifier
- java 深拷贝和浅拷贝
- ISE中显示IP核的图形化界面
- jQuery Validate插件添加自定义验证
- HTML中table标签中thead、tbody、tfoot的作用
- 数据结构实验之排序四:寻找大富翁