|
|
@ -49,7 +49,8 @@ public class RedisConfig extends CachingConfigurerSupport {
|
|
|
|
if (ObjectUtil.isNotNull(singleServerConfig)) {
|
|
|
|
if (ObjectUtil.isNotNull(singleServerConfig)) {
|
|
|
|
// 使用单机模式
|
|
|
|
// 使用单机模式
|
|
|
|
config.useSingleServer()
|
|
|
|
config.useSingleServer()
|
|
|
|
.setNameMapper(new KeyPrefixHandler(redissonProperties.getKeyPrefix()))//设置redis key前缀
|
|
|
|
//设置redis key前缀
|
|
|
|
|
|
|
|
.setNameMapper(new KeyPrefixHandler(redissonProperties.getKeyPrefix()))
|
|
|
|
.setTimeout(singleServerConfig.getTimeout())
|
|
|
|
.setTimeout(singleServerConfig.getTimeout())
|
|
|
|
.setClientName(singleServerConfig.getClientName())
|
|
|
|
.setClientName(singleServerConfig.getClientName())
|
|
|
|
.setIdleConnectionTimeout(singleServerConfig.getIdleConnectionTimeout())
|
|
|
|
.setIdleConnectionTimeout(singleServerConfig.getIdleConnectionTimeout())
|
|
|
@ -61,7 +62,8 @@ public class RedisConfig extends CachingConfigurerSupport {
|
|
|
|
RedissonProperties.ClusterServersConfig clusterServersConfig = redissonProperties.getClusterServersConfig();
|
|
|
|
RedissonProperties.ClusterServersConfig clusterServersConfig = redissonProperties.getClusterServersConfig();
|
|
|
|
if (ObjectUtil.isNotNull(clusterServersConfig)) {
|
|
|
|
if (ObjectUtil.isNotNull(clusterServersConfig)) {
|
|
|
|
config.useClusterServers()
|
|
|
|
config.useClusterServers()
|
|
|
|
.setNameMapper(new KeyPrefixHandler(redissonProperties.getKeyPrefix()))//设置redis key前缀
|
|
|
|
//设置redis key前缀
|
|
|
|
|
|
|
|
.setNameMapper(new KeyPrefixHandler(redissonProperties.getKeyPrefix()))
|
|
|
|
.setTimeout(clusterServersConfig.getTimeout())
|
|
|
|
.setTimeout(clusterServersConfig.getTimeout())
|
|
|
|
.setClientName(clusterServersConfig.getClientName())
|
|
|
|
.setClientName(clusterServersConfig.getClientName())
|
|
|
|
.setIdleConnectionTimeout(clusterServersConfig.getIdleConnectionTimeout())
|
|
|
|
.setIdleConnectionTimeout(clusterServersConfig.getIdleConnectionTimeout())
|
|
|
|