mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2026-03-22 02:37:18 +08:00
!255 fix 修复 RedisMetadataReport 缺少 username 参数支持的问题
* fix 修复 RedisMetadataReport 缺少 username 参数支持的问题
This commit is contained in:
@@ -55,6 +55,7 @@ public class RedisMetadataReport extends AbstractMetadataReport {
|
||||
protected JedisPool pool;
|
||||
private Set<HostAndPort> jedisClusterNodes;
|
||||
private int timeout;
|
||||
private String username;
|
||||
private String password;
|
||||
private final String root;
|
||||
private final ConcurrentHashMap<String, MappingDataListener> mappingDataListenerMap = new ConcurrentHashMap<>();
|
||||
@@ -63,6 +64,7 @@ public class RedisMetadataReport extends AbstractMetadataReport {
|
||||
public RedisMetadataReport(URL url) {
|
||||
super(url);
|
||||
timeout = url.getParameter(TIMEOUT_KEY, DEFAULT_TIMEOUT);
|
||||
username = url.getUsername();
|
||||
password = url.getPassword();
|
||||
this.root = url.getGroup(DEFAULT_ROOT);
|
||||
if (url.getParameter(CYCLE_REPORT_KEY, DEFAULT_METADATA_REPORT_CYCLE_REPORT)) {
|
||||
@@ -77,7 +79,7 @@ public class RedisMetadataReport extends AbstractMetadataReport {
|
||||
}
|
||||
} else {
|
||||
int database = url.getParameter(REDIS_DATABASE_KEY, 0);
|
||||
pool = new JedisPool(new JedisPoolConfig(), url.getHost(), url.getPort(), timeout, password, database);
|
||||
pool = new JedisPool(new JedisPoolConfig(), url.getHost(), url.getPort(), timeout, username, password, database);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ dubbo:
|
||||
metadata-report:
|
||||
address: redis://${spring.data.redis.host:localhost}:${spring.data.redis.port:6379}
|
||||
group: DUBBO_GROUP
|
||||
username: dubbo
|
||||
username: ${spring.data.redis.username:default}
|
||||
password: ${spring.data.redis.password}
|
||||
parameters:
|
||||
namespace: ${spring.profiles.active}
|
||||
|
||||
Reference in New Issue
Block a user