Skip to content

Commit b78eca4

Browse files
committed
Redis Client: deprecate hash-slot-cache-ttl and add topology-cache-ttl
This commit shall not be backported, because it deprecates a config option for removal since Quarkus 3.30.
1 parent 5e19f1b commit b78eca4

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/client/VertxRedisClientFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public void accept(Set<URI> uris) {
102102
config.poolRecycleTimeout().ifPresent(d -> options.setPoolRecycleTimeout((int) d.toMillis()));
103103
// the Vert.x Redis client will only unify `topologyCacheTTL` and `hashSlotCacheTTL` in version 5.1,
104104
// but in Quarkus, we unify them already
105-
long topologyCacheTtl = config.hashSlotCacheTtl().toMillis();
105+
long topologyCacheTtl = config.topologyCacheTtl().orElse(config.hashSlotCacheTtl()).toMillis();
106106
options.setHashSlotCacheTTL(topologyCacheTtl);
107107
options.setTopologyCacheTTL(topologyCacheTtl);
108108

extensions/redis-client/runtime/src/main/java/io/quarkus/redis/runtime/client/config/RedisClientConfig.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ public interface RedisClientConfig {
147147
@ConfigDocDefault("resp3")
148148
Optional<ProtocolVersion> preferredProtocolVersion();
149149

150+
/**
151+
* @deprecated use {@code quarkus.redis.topology-cache-ttl}
152+
*/
153+
@Deprecated(forRemoval = true, since = "3.30")
154+
@WithDefault("1s")
155+
Duration hashSlotCacheTtl();
156+
150157
/**
151158
* The TTL of the topology cache. A topology cache is used by a clustered Redis client
152159
* and a sentinel Redis client to prevent constantly sending topology discovery commands
@@ -156,7 +163,7 @@ public interface RedisClientConfig {
156163
* Redis client and has no effect otherwise.
157164
*/
158165
@WithDefault("1s")
159-
Duration hashSlotCacheTtl();
166+
Optional<Duration> topologyCacheTtl();
160167

161168
/**
162169
* Whether automatic failover is enabled. This only makes sense for sentinel clients

0 commit comments

Comments
 (0)