聊聊spring-boot-starter-data-redis的配置变更
本文主要研究一下spring-boot-starter-data-redis的配置变更
配置变更
以前是spring-boot的1.4.x版本的(spring-data-redis为1.7.x版本),最近切到2.0.4.RELEASEB版本(spring-data-redis为2.0.5.RELEASE版本),发现配置有变更。
旧版配置
spring.redis.database=0
spring.redis.host=192.168.99.100
spring.redis.port=6379
#spring.redis.password= # Login password of the redis server.
spring.redis.pool.max-active=8
spring.redis.pool.max-idle=8
spring.redis.pool.max-wait=-1
spring.redis.pool.min-idle=0
#spring.redis.sentinel.master= # Name of Redis server.
#spring.redis.sentinel.nodes= # Comma-separated list of host:port pairs.
spring.redis.timeout=10
新版本配置
spring.redis.database=0
spring.redis.host=192.168.99.100
spring.redis.port=6379
#spring.redis.password= # Login password of the redis server.
spring.redis.lettuce.pool.max-active=8
spring.redis.lettuce.pool.max-idle=8
spring.redis.lettuce.pool.max-wait=-1ms
spring.redis.lettuce.pool.min-idle=0
#spring.redis.sentinel.master= # Name of Redis server.
#spring.redis.sentinel.nodes= # Comma-separated list of host:port pairs.
spring.redis.timeout=100ms
小结
新版spring-boot-starter-data-redis有几个变更如下:
- spring.redis底下除了公共的配置外,区分两个不同的实现,jedis及lettuce
- 公共配置spring.redis.timeout的参数改为Duration类型,需要增加时间单位参数
- spring-boot-starter-data-redis新版默认是使用lettuce
- redis连接池需要引入commons-pool2类库,由于该类库新版本的一些核心类有变动,因此需要注意下版本号,超过2.4.3版本的可能会有问题
聊聊spring-boot-starter-data-redis的配置变更的更多相关文章
- 自定义的Spring Boot starter如何设置自动配置注解
本文首发于个人网站: 在Spring Boot实战之定制自己的starter一文最后提到,触发Spring Boot的配置过程有两种方法: spring.factories:由Spring Boot触 ...
- spring -boot s-tarter 详解
Starter POMs是可以包含到应用中的一个方便的依赖关系描述符集合.你可以获取所有Spring及相关技术的一站式服务,而不需要翻阅示例代码,拷贝粘贴大量的依赖描述符.例如,如果你想使用Sprin ...
- Spring Boot 2.x Redis多数据源配置(jedis,lettuce)
Spring Boot 2.x Redis多数据源配置(jedis,lettuce) 96 不敢预言的预言家 0.1 2018.11.13 14:22* 字数 65 阅读 727评论 0喜欢 2 多数 ...
- Druid Spring Boot Starter 从配置到简单运行 -解决zone不匹配 -解决dataSource加载失败
Druid Spring Boot Starter 中文 | English Druid Spring Boot Starter 用于帮助你在Spring Boot项目中轻松集成Druid数据库连接池 ...
- spring data jpa和spring data redis同时配置时,出现Multiple Spring Data modules found, entering strict repository configuration mode错误
问题说明 data jpa和data redis同时配置时,出现Spring modules spring Spring Data Release Train <dependencyManage ...
- 聊聊 Spring Boot 2.x 那些事儿
本文目录: 即将的 Spring 2.0 - Spring 2.0 是什么 - 开发环境和 IDE - 使用 Spring Initializr 快速入门 Starter 组件 - Web:REST ...
- SpringBoot 之Spring Boot Starter依赖包及作用
Spring Boot 之Spring Boot Starter依赖包及作用 spring-boot-starter 这是Spring Boot的核心启动器,包含了自动配置.日志和YAML. spri ...
- Spring Boot Starter列表
转自:http://blog.sina.com.cn/s/blog_798f713f0102wiy5.html Spring Boot Starter 基本的一共有43种,具体如下: 1)spring ...
- Spring Boot Starter 介绍
http://www.baeldung.com/spring-boot-starters 作者:baeldung 译者:http://oopsguy.com 1.概述 依赖管理是任何复杂项目的关键部分 ...
- Spring Boot (一): Spring Boot starter自定义
前些日子在公司接触了spring boot和spring cloud,有感于其大大简化了spring的配置过程,十分方便使用者快速构建项目,而且拥有丰富的starter供开发者使用.但是由于其自动化配 ...
随机推荐
- python__基础数据类型
字符串和常用数据结构 使用字符串 第二次世界大战促使了现代电子计算机的诞生,当初的想法很简单,就是用计算机来计算导弹的弹道,因此在计算机刚刚诞生的那个年代,计算机处理的信息主要是数值,而世界上的第一台 ...
- 一个php文件就可以把数据库的数据导出Excel表格
数据库内容太多,复制粘贴太麻烦?那就用代码实现把,把代码写好了,导出还不容易吗,访问即可导出. excel.php <?php error_reporting(E_ALL ^ E_DEPRECA ...
- Exchange 2010 详细安装步骤
工具/原料 系统要求:windows 2008 R2 标准版或者企业版 Exchange Server 2010 SP3:https://www.microsoft.com/en-us/downl ...
- AStar 启发函数设计(老物)
作为我出山的第一篇日志,怎么也得写篇对得起我身份和地位的文章吧? 先容我吐槽一下不小心发的贴图,那个只是我不小心收藏了隔壁兄弟班的课表就别大家这么热情的 BB 我感到很有压力,额,废话不多说,立刻进入 ...
- Mac下的常用快捷键总结
由于在公司的时候是使用的Windows下进行开发工作,但是回家之后,有时候要使用自己的Mac进行开发等工作,那么流利的使用快捷键就变得尤其的重要. 1. 退出软件 cmd + q 2.将最前面的窗口最 ...
- (转) 【oracle调优】优化全表扫---cache整张表或索引
情景分析: 1)某查询必须要走全表扫描 2)该查询执行的频率相当高 3)对执行时间的要求也相当苛刻的话 4)数据库的IO比较吃紧 5)数据库的内存比较宽松 6)该表的大小没有大到离谱 以上情况下,可以 ...
- Vue基础第三章 - 计算属性
1.计算属性介绍 在第二章中我们介绍了在Vue的{{}}中可以使用一些简单的表达式进行计算,但是当表达式过长或者逻辑过于复杂就会变得不易理解和维护,比如第二章的示例{{ text.split(',') ...
- linux就该这么学.pdf
链接:https://pan.baidu.com/s/1mhYIqgg 密码:ay0j
- Mybatis 动态sql(转载)
原文地址:http://www.cnblogs.com/dongying/p/4092662.html 传统的使用JDBC的方法,相信大家在组合复杂的的SQL语句的时候,需要去拼接,稍不注意哪怕少了个 ...
- 批处理实现自动Git push
用Git用的多,每次修改文件后都需要敲几条命令: git add git commit git push ······ 太麻烦了 于是想到使用批处理(.bat)来自动化这个过程(注意:Windows环 ...