update redisson 3.25.2 => 3.27.0 支持虚拟线程

2.X
疯狂的狮子Li 11 months ago
parent 377f7c249f
commit 8c43d1bfc1

@ -32,7 +32,7 @@
<poi.version>5.2.3</poi.version>
<easyexcel.version>3.3.3</easyexcel.version>
<hutool.version>5.8.24</hutool.version>
<redisson.version>3.25.2</redisson.version>
<redisson.version>3.27.0</redisson.version>
<lock4j.version>2.2.7</lock4j.version>
<powerjob.version>4.3.6</powerjob.version>
<satoken.version>1.37.0</satoken.version>

@ -6,6 +6,7 @@ import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator;
import lombok.extern.slf4j.Slf4j;
import org.dromara.common.core.utils.SpringUtils;
import org.dromara.common.redis.config.properties.RedissonProperties;
import org.dromara.common.redis.handler.KeyPrefixHandler;
import org.redisson.client.codec.StringCodec;
@ -16,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.core.task.VirtualThreadTaskExecutor;
/**
* redis
@ -48,6 +50,9 @@ public class RedisConfiguration {
// 缓存 Lua 脚本 减少网络传输(redisson 大部分的功能都是基于 Lua 脚本实现)
.setUseScriptCache(true)
.setCodec(codec);
if (SpringUtils.isVirtual()) {
config.setNettyExecutor(new VirtualThreadTaskExecutor("redisson-"));
}
RedissonProperties.SingleServerConfig singleServerConfig = redissonProperties.getSingleServerConfig();
if (ObjectUtil.isNotNull(singleServerConfig)) {
// 使用单机模式

Loading…
Cancel
Save