diff --git a/docs/user-guide/connecting-redis.md b/docs/user-guide/connecting-redis.md
index 9e2d2eed5f..5714d664cd 100644
--- a/docs/user-guide/connecting-redis.md
+++ b/docs/user-guide/connecting-redis.md
@@ -195,8 +195,8 @@ the error message. `RedisException` is a `RuntimeException`.
### Examples
``` java
-RedisClient client = RedisClient.create(RedisURI.create("localhost", 6379));
-client.setDefaultTimeout(20, TimeUnit.SECONDS);
+RedisURI uri = new RedisURI("localhost", 6379, Duration.ofSeconds(20));
+RedisClient client = RedisClient.create(uri);
// …
diff --git a/src/main/java/io/lettuce/core/AbstractRedisClient.java b/src/main/java/io/lettuce/core/AbstractRedisClient.java
index fcb65f2914..a7e4b65d8f 100644
--- a/src/main/java/io/lettuce/core/AbstractRedisClient.java
+++ b/src/main/java/io/lettuce/core/AbstractRedisClient.java
@@ -109,8 +109,6 @@ public abstract class AbstractRedisClient implements AutoCloseable {
private volatile ClientOptions clientOptions = ClientOptions.create();
- private volatile Duration defaultTimeout = RedisURI.DEFAULT_TIMEOUT_DURATION;
-
/**
* Create a new instance with client resources.
*
@@ -134,47 +132,6 @@ protected int getChannelCount() {
return channels.size();
}
- /**
- * Returns the default {@link Duration timeout} for commands.
- *
- * @return the default {@link Duration timeout} for commands.
- * @deprecated since 6.2, use {@link RedisURI#getTimeout()} to control timeouts.
- */
- @Deprecated
- public Duration getDefaultTimeout() {
- return defaultTimeout;
- }
-
- /**
- * Set the default timeout for connections created by this client. The timeout applies to connection attempts and
- * non-blocking commands.
- *
- * @param timeout default connection timeout, must not be {@code null}.
- * @since 5.0
- * @deprecated since 6.2, use {@link RedisURI#getTimeout()} to control timeouts.
- */
- @Deprecated
- public void setDefaultTimeout(Duration timeout) {
-
- LettuceAssert.notNull(timeout, "Timeout duration must not be null");
- LettuceAssert.isTrue(!timeout.isNegative(), "Timeout duration must be greater or equal to zero");
-
- this.defaultTimeout = timeout;
- }
-
- /**
- * Set the default timeout for connections created by this client. The timeout applies to connection attempts and
- * non-blocking commands.
- *
- * @param timeout Default connection timeout.
- * @param unit Unit of time for the timeout.
- * @deprecated since 6.2, use {@link RedisURI#getTimeout()} to control timeouts.
- */
- @Deprecated
- public void setDefaultTimeout(long timeout, TimeUnit unit) {
- setDefaultTimeout(Duration.ofNanos(unit.toNanos(timeout)));
- }
-
/**
* Returns the {@link ClientOptions} which are valid for that client. Connections inherit the current options at the moment
* the connection is created. Changes to options will not affect existing connections.
diff --git a/src/main/java/io/lettuce/core/RedisClient.java b/src/main/java/io/lettuce/core/RedisClient.java
index 78b28d3a10..7825161bb3 100644
--- a/src/main/java/io/lettuce/core/RedisClient.java
+++ b/src/main/java/io/lettuce/core/RedisClient.java
@@ -105,7 +105,6 @@ protected RedisClient(ClientResources clientResources, RedisURI redisURI) {
assertNotNull(redisURI);
this.redisURI = redisURI;
- setDefaultTimeout(redisURI.getTimeout());
}
/**
@@ -217,7 +216,7 @@ public connectStatefulAsync(StatefulRedisConnecti
* @return A new stateful pub/sub connection
*/
public StatefulRedisPubSubConnection
- All connections inherit a default timeout from their {@link io.lettuce.core.RedisClient} + All connections inherit a default timeout from their {@link io.lettuce.core.RedisURI} and will throw a {@link io.lettuce.core.RedisException} when non-blocking commands fail to return a result before the timeout expires. The timeout defaults to 60 seconds and - may be changed via {@link io.lettuce.core.RedisClient#setDefaultTimeout} or for + may be changed via {@link io.lettuce.core.RedisURI#setTimeout} or for each individual connection.