|
3 years ago | |
---|---|---|
.. | ||
src | 4 years ago | |
README.md | 6 years ago | |
pom.xml | 3 years ago |
Redis 缓存支持模块
配置
# 使用 redis 时需要使用下列配置类配置 redis 连接
# redis 主机名或 IP 地址
cache.redis.hostName=localhost
# redis 端口
cache.redis.port=6379
# redis 数据库号
cache.redis.database=0
# 默认过期时间, 单位秒, 默认 600 秒(10分钟)
cache.redis.expireTime=600
cache.redis.password=@null
# cache 过期时间, 可以针对具体的 cacheName 单独设置(格式:json)
cache.redis.expiresMap={'cache1':3600,'cache2':600}
#连接池中最大连接数。高版本:maxTotal,低版本:maxActive
cache.redis.maxActive=200
#连接池中最大空闲的连接
cache.redis.maxIdle=20
#连接池中最少空闲的连接数
cache.redis.minIdle=1
#当连接池资源耗尽时,调用者最大阻塞的时间,超时将跑出异常。单位,毫秒数;默认为-1.表示永不超时。高版本:maxWaitMillis,低版本:maxWait
#ache.redis.maxWaitMillis=5000
#连接空闲的最小时间,达到此值后空闲连接将可能会被移除。负值(-1)表示不移除
#ache.redis.minEvictableIdleTimeMillis=300000
#对于“空闲链接”检测线程而言,每次检测的链接资源的个数。默认为3
cache.redis.numTestsPerEvictionRun=3
#“空闲链接”检测线程,检测的周期,毫秒数。如果为负值,表示不运行“检测线程”。默认为-1.
cache.redis.timeBetweenEvictionRunsMillis=60000