DBZ-7646 Support empty or null user/passwords with Redis connections

This commit is contained in:
eizners 2024-03-14 15:52:22 -04:00 committed by Chris Cranford
parent 71256cf1bc
commit 4cd477dd6b

View File

@ -11,6 +11,7 @@
import org.slf4j.LoggerFactory;
import io.debezium.DebeziumException;
import io.debezium.util.Strings;
import redis.clients.jedis.DefaultJedisClientConfig;
import redis.clients.jedis.HostAndPort;
@ -81,10 +82,10 @@ public RedisClient getRedisClient(String clientName, boolean waitEnabled, long w
client = new Jedis(address, DefaultJedisClientConfig.builder().database(this.dbIndex).connectionTimeoutMillis(this.connectionTimeout)
.socketTimeoutMillis(this.socketTimeout).ssl(this.sslEnabled).build());
if (this.user != null) {
if (!Strings.isNullOrEmpty(this.user)) {
client.auth(this.user, this.password);
}
else if (this.password != null) {
else if (!Strings.isNullOrEmpty(this.password)) {
client.auth(this.password);
}
else {