🔨 修改 redisson 配置.
This commit is contained in:
@@ -7,6 +7,7 @@ import com.orion.visor.framework.redis.configuration.config.RedissonConfig;
|
|||||||
import com.orion.visor.framework.redis.core.lock.RedisLocker;
|
import com.orion.visor.framework.redis.core.lock.RedisLocker;
|
||||||
import com.orion.visor.framework.redis.core.utils.RedisUtils;
|
import com.orion.visor.framework.redis.core.utils.RedisUtils;
|
||||||
import org.redisson.api.RedissonClient;
|
import org.redisson.api.RedissonClient;
|
||||||
|
import org.redisson.config.SingleServerConfig;
|
||||||
import org.redisson.spring.starter.RedissonAutoConfigurationCustomizer;
|
import org.redisson.spring.starter.RedissonAutoConfigurationCustomizer;
|
||||||
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
import org.springframework.boot.autoconfigure.AutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
|
import org.springframework.boot.autoconfigure.AutoConfigureOrder;
|
||||||
@@ -58,6 +59,9 @@ public class OrionRedisAutoConfiguration {
|
|||||||
return config -> {
|
return config -> {
|
||||||
config.setThreads(redissonConfig.getThreads());
|
config.setThreads(redissonConfig.getThreads());
|
||||||
config.setNettyThreads(redissonConfig.getNettyThreads());
|
config.setNettyThreads(redissonConfig.getNettyThreads());
|
||||||
|
// 单机配置
|
||||||
|
SingleServerConfig single = config.useSingleServer();
|
||||||
|
single.setConnectionMinimumIdleSize(redissonConfig.getMinimumIdleSize());
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,9 +24,15 @@ public class RedissonConfig {
|
|||||||
*/
|
*/
|
||||||
private Integer nettyThreads;
|
private Integer nettyThreads;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 最小空闲连接数
|
||||||
|
*/
|
||||||
|
private Integer minimumIdleSize;
|
||||||
|
|
||||||
public RedissonConfig() {
|
public RedissonConfig() {
|
||||||
this.threads = 16;
|
this.threads = 16;
|
||||||
this.nettyThreads = 16;
|
this.nettyThreads = 16;
|
||||||
|
this.minimumIdleSize = 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,12 @@
|
|||||||
"type": "java.lang.Integer",
|
"type": "java.lang.Integer",
|
||||||
"description": "netty 线程数.",
|
"description": "netty 线程数.",
|
||||||
"defaultValue": "16"
|
"defaultValue": "16"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "spring.redisson.minimum-idle-size",
|
||||||
|
"type": "java.lang.Integer",
|
||||||
|
"description": "最小空闲连接数.",
|
||||||
|
"defaultValue": "16"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -14,6 +14,7 @@ spring:
|
|||||||
redisson:
|
redisson:
|
||||||
threads: 2
|
threads: 2
|
||||||
netty-threads: 2
|
netty-threads: 2
|
||||||
|
minimum-idle-size: 2
|
||||||
|
|
||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
configuration:
|
configuration:
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ spring:
|
|||||||
redisson:
|
redisson:
|
||||||
threads: 4
|
threads: 4
|
||||||
netty-threads: 4
|
netty-threads: 4
|
||||||
|
minimum-idle-size: 4
|
||||||
quartz:
|
quartz:
|
||||||
properties:
|
properties:
|
||||||
org:
|
org:
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ spring:
|
|||||||
redisson:
|
redisson:
|
||||||
threads: 2
|
threads: 2
|
||||||
netty-threads: 2
|
netty-threads: 2
|
||||||
|
minimum-idle-size: 2
|
||||||
|
|
||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
lazy-initialization: true
|
lazy-initialization: true
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ spring:
|
|||||||
redisson:
|
redisson:
|
||||||
threads: 2
|
threads: 2
|
||||||
netty-threads: 2
|
netty-threads: 2
|
||||||
|
minimum-idle-size: 2
|
||||||
|
|
||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
lazy-initialization: true
|
lazy-initialization: true
|
||||||
|
|||||||
Reference in New Issue
Block a user