mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-20 09:28:58 +08:00
🎨 qidian模块starter模块适配springboot3
This commit is contained in:
parent
5e84544ae7
commit
d470e9a693
2
pom.xml
2
pom.xml
@ -280,7 +280,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>redis.clients</groupId>
|
<groupId>redis.clients</groupId>
|
||||||
<artifactId>jedis</artifactId>
|
<artifactId>jedis</artifactId>
|
||||||
<version>3.3.0</version>
|
<version>4.3.2</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@ -21,9 +21,9 @@ import org.springframework.context.annotation.Bean;
|
|||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
import org.springframework.data.redis.core.StringRedisTemplate;
|
import org.springframework.data.redis.core.StringRedisTemplate;
|
||||||
import redis.clients.jedis.JedisPool;
|
import redis.clients.jedis.JedisPool;
|
||||||
import redis.clients.jedis.JedisPoolAbstract;
|
|
||||||
import redis.clients.jedis.JedisPoolConfig;
|
import redis.clients.jedis.JedisPoolConfig;
|
||||||
import redis.clients.jedis.JedisSentinelPool;
|
import redis.clients.jedis.JedisSentinelPool;
|
||||||
|
import redis.clients.jedis.util.Pool;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ public class WxQidianStorageAutoConfiguration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private WxQidianConfigStorage jedisConfigStorage() {
|
private WxQidianConfigStorage jedisConfigStorage() {
|
||||||
JedisPoolAbstract jedisPool;
|
Pool jedisPool;
|
||||||
if (StringUtils.isNotEmpty(redisHost) || StringUtils.isNotEmpty(redisHost2)) {
|
if (StringUtils.isNotEmpty(redisHost) || StringUtils.isNotEmpty(redisHost2)) {
|
||||||
jedisPool = getJedisPool();
|
jedisPool = getJedisPool();
|
||||||
} else {
|
} else {
|
||||||
@ -136,7 +136,7 @@ public class WxQidianStorageAutoConfiguration {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private JedisPoolAbstract getJedisPool() {
|
private Pool getJedisPool() {
|
||||||
WxQidianProperties.ConfigStorage storage = wxQidianProperties.getConfigStorage();
|
WxQidianProperties.ConfigStorage storage = wxQidianProperties.getConfigStorage();
|
||||||
RedisProperties redis = storage.getRedis();
|
RedisProperties redis = storage.getRedis();
|
||||||
|
|
||||||
@ -156,8 +156,9 @@ public class WxQidianStorageAutoConfiguration {
|
|||||||
config.setTestOnBorrow(true);
|
config.setTestOnBorrow(true);
|
||||||
config.setTestWhileIdle(true);
|
config.setTestWhileIdle(true);
|
||||||
if (StringUtils.isNotEmpty(redis.getSentinelIps())) {
|
if (StringUtils.isNotEmpty(redis.getSentinelIps())) {
|
||||||
|
|
||||||
Set<String> sentinels = Sets.newHashSet(redis.getSentinelIps().split(","));
|
Set<String> sentinels = Sets.newHashSet(redis.getSentinelIps().split(","));
|
||||||
return new JedisSentinelPool(redis.getSentinelName(), sentinels);
|
return new JedisSentinelPool(redis.getSentinelName(), sentinels,config);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new JedisPool(config, redis.getHost(), redis.getPort(), redis.getTimeout(), redis.getPassword(),
|
return new JedisPool(config, redis.getHost(), redis.getPort(), redis.getTimeout(), redis.getPassword(),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user