Don't send `CLIENT SETINFO` commands when connecting to Redis instances

This commit is contained in:
Jon Chambers 2024-11-05 17:18:50 -05:00 committed by Jon Chambers
parent 8c984cbf42
commit d8f53954d0
2 changed files with 24 additions and 0 deletions

View File

@ -59,6 +59,17 @@ public class FaultTolerantRedisClient {
this.name = name;
// Lettuce will issue a CLIENT SETINFO command unconditionally if these fields are set (and they are by default),
// which can generate a bunch of spurious warnings in versions of Redis before 7.2.0.
//
// See:
//
// - https://github.com/redis/lettuce/pull/2823
// - https://github.com/redis/lettuce/issues/2817
redisUri.setClientName(null);
redisUri.setLibraryName(null);
redisUri.setLibraryVersion(null);
final LettuceShardCircuitBreaker lettuceShardCircuitBreaker = new LettuceShardCircuitBreaker(name,
circuitBreakerConfiguration.toCircuitBreakerConfig(), Schedulers.newSingle("topology-changed-" + name, true));
this.redisClient = RedisClient.create(clientResourcesBuilder.build(), redisUri);

View File

@ -75,6 +75,19 @@ public class FaultTolerantRedisClusterClient {
this.name = name;
// Lettuce will issue a CLIENT SETINFO command unconditionally if these fields are set (and they are by default),
// which can generate a bunch of spurious warnings in versions of Redis before 7.2.0.
//
// See:
//
// - https://github.com/redis/lettuce/pull/2823
// - https://github.com/redis/lettuce/issues/2817
redisUris.forEach(redisUri -> {
redisUri.setClientName(null);
redisUri.setLibraryName(null);
redisUri.setLibraryVersion(null);
});
final LettuceShardCircuitBreaker lettuceShardCircuitBreaker = new LettuceShardCircuitBreaker(name,
circuitBreakerConfig.toCircuitBreakerConfig(), Schedulers.newSingle("topology-changed-" + name, true));
this.clusterClient = RedisClusterClient.create(