Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/develop/connect/clients/java/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ You have two choices of Java clients that you can use with Redis:

- [Jedis]({{< relref "/develop/connect/clients/java/jedis" >}}), for synchronous applications.
- [Lettuce]({{< relref "/develop/connect/clients/java/lettuce" >}}),
for asynchronous and reactive applications.
for synchronous, asynchronous, and reactive applications.

You can also access Redis with an object-mapping client interface. See
[RedisOM for Java]({{< relref "/integrate/redisom-for-java" >}})
Expand Down
4 changes: 2 additions & 2 deletions content/develop/connect/clients/java/jedis.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ title: Jedis guide
weight: 1
---

[Jedis](https://github.com/redis/jedis) is the *synchronous* Java client for Redis.
[Jedis](https://github.com/redis/jedis) is a synchronous Java client for Redis.
Use [Lettuce]({{< relref "/develop/connect/clients/java/lettuce" >}}) if you need
an *asynchronous* Java client.
a more advanced Java client that also supports asynchronous and reactive connections.
The sections below explain how to install `Jedis` and connect your application
to a Redis database.

Expand Down
20 changes: 12 additions & 8 deletions content/develop/connect/clients/java/lettuce.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ title: Lettuce guide
weight: 2
---

[Lettuce](https://github.com/redis/lettuce/tree/main/src/main) is the *asynchronous* Java client for Redis.
Use [Jedis]({{< relref "/develop/connect/clients/java/jedis" >}}) if you need
a *synchronous* Java client.
[Lettuce](https://github.com/redis/lettuce/tree/main/src/main) is an advanced Java client for Redis
that supports synchronous, asynchronous, and reactive connections.
If you only need synchronous connections then you may find the other Java client
[Jedis]({{< relref "/develop/connect/clients/java/jedis" >}}) easier to use.

The sections below explain how to install `Lettuce` and connect your application
to a Redis database.

Expand Down Expand Up @@ -94,7 +96,7 @@ public class Async {
}
```

Learn more about asynchronous Lettuce API in [the reference guide](https://lettuce.io/core/release/reference/index.html#asynchronous-api).
Learn more about asynchronous Lettuce API in [the reference guide](https://redis.github.io/lettuce/#asynchronous-api).

### Reactive connection

Expand Down Expand Up @@ -136,7 +138,7 @@ public class Main {
}
```

Learn more about reactive Lettuce API in [the reference guide](https://lettuce.io/core/release/reference/index.html#reactive-api).
Learn more about reactive Lettuce API in [the reference guide](https://redis.github.io/lettuce/#reactive-api).

### Redis Cluster connection

Expand Down Expand Up @@ -178,14 +180,15 @@ RedisClient client = RedisClient.create(redisUri);
Lettuce uses `ClientResources` for efficient management of shared resources like event loop groups and thread pools.
For connection pooling, Lettuce leverages `RedisClient` or `RedisClusterClient`, which can handle multiple concurrent connections efficiently.

### Timouts
### Timeouts

Lettuce provides timeouts for many operations, such as command execution, SSL handshake, and Sentinel discovery. By default, Lettuce uses a global timeout value of 60 seconds for these operations, but you can override the global timeout value with individual timeout values for each operation.

{{% alert title="Tip" color="warning" %}}
Choosing suitable timeout values is crucial for your application's performance and stability and is specific to each environment.
Configuring timeouts is only necessary if you have issues with the default values.
In some cases, the defaults are based on environment-specific settings (e.g., operating system settings), while in other cases, they are built into the Lettuce driver.
For more details on setting specific timeouts, see the [Lettuce reference guide](https://lettuce.io/core/release/reference/index.html).
For more details on setting specific timeouts, see the [Lettuce reference guide](https://redis.github.io/lettuce/).
{{% /alert %}}

Below is an example of setting socket-level timeouts. The `TCP_USER_TIMEOUT` setting is useful for scenarios where the server stops responding without acknowledging the last request, while the `KEEPALIVE` setting is good for detecting dead connections where there is no traffic between the client and the server.
Expand Down Expand Up @@ -228,6 +231,7 @@ try (RedisClient client = RedisClient.create(redisURI)) {
```

### Connection pooling

A typical approach with Lettuce is to create a single `RedisClient` instance and reuse it to establish connections to your Redis server(s).
These connections are multiplexed; that is, multiple commands can be run concurrently over a single or a small set of connections, making explicit pooling less practical.

Expand Down Expand Up @@ -300,6 +304,6 @@ java.security.Security.setProperty("networkaddress.cache.negative.ttl", "0");

## Learn more

- [Lettuce reference documentation](https://lettuce.io/docs/)
- [Lettuce reference documentation](https://redis.github.io/lettuce/)
- [Redis commands]({{< relref "/commands" >}})
- [Project Reactor](https://projectreactor.io/)
2 changes: 1 addition & 1 deletion content/embeds/r7.2-migration-guides.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Migration guides for certain clients

If you are using [Go-Redis](https://redis.uptrace.dev/) v9 or [Lettuce](https://lettuce.io/) v6+, which by default switch to the RESP3 protocol, and you are running Redis Stack commands, please make sure the protocol version is pinned to RESP2 prior to upgrading to Redis version 7.2.
If you are using [Go-Redis](https://redis.uptrace.dev/) v9 or [Lettuce](https://redis.github.io/lettuce/) v6+, which by default switch to the RESP3 protocol, and you are running Redis Stack commands, please make sure the protocol version is pinned to RESP2 prior to upgrading to Redis version 7.2.

#### Go-Redis

Expand Down
2 changes: 1 addition & 1 deletion content/operate/rs/references/compatibility/resp.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ To change `resp3_default` to `disabled`, use one of the following methods:

## Client prerequisites for Redis 7.2 upgrade

The Redis clients [Go-Redis](https://redis.uptrace.dev/) version 9 and [Lettuce](https://lettuce.io/) versions 6 and later use RESP3 by default. If you use either client to run Redis Stack commands, you should set the client's protocol version to RESP2 before upgrading your database to Redis version 7.2 to prevent potential application issues due to RESP3 breaking changes.
The Redis clients [Go-Redis](https://redis.uptrace.dev/) version 9 and [Lettuce](https://redis.github.io/lettuce/) versions 6 and later use RESP3 by default. If you use either client to run Redis Stack commands, you should set the client's protocol version to RESP2 before upgrading your database to Redis version 7.2 to prevent potential application issues due to RESP3 breaking changes.

### Go-Redis

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ To use RESP3 with Redis Enterprise:
rladmin tune db db:<ID> resp3 enabled
```

If you run Redis Stack commands with Redis clients [Go-Redis](https://redis.uptrace.dev/) version 9 or [Lettuce](https://lettuce.io/) versions 6 and later, see [client prerequisites](#client-prerequisites-for-redis-72-upgrade) before you upgrade to Redis 7.2 to learn how to prevent potential application issues due to RESP3 breaking changes.
If you run Redis Stack commands with Redis clients [Go-Redis](https://redis.uptrace.dev/) version 9 or [Lettuce](https://redis.github.io/lettuce/) versions 6 and later, see [client prerequisites](#client-prerequisites-for-redis-72-upgrade) before you upgrade to Redis 7.2 to learn how to prevent potential application issues due to RESP3 breaking changes.

#### Sharded pub/sub

Expand Down Expand Up @@ -424,7 +424,7 @@ Starting from Redis Enterprise version 7.2, all future 7.2.x upgrades are suppor

#### Client prerequisites for Redis 7.2 upgrade

The Redis clients [Go-Redis](https://redis.uptrace.dev/) version 9 and [Lettuce](https://lettuce.io/) versions 6 and later use RESP3 by default. If you use either client to run Redis Stack commands, you should set the client's protocol version to RESP2 before upgrading your database to Redis version 7.2 to prevent potential application issues due to RESP3 breaking changes.
The Redis clients [Go-Redis](https://redis.uptrace.dev/) version 9 and [Lettuce](https://redis.github.io/lettuce/) versions 6 and later use RESP3 by default. If you use either client to run Redis Stack commands, you should set the client's protocol version to RESP2 before upgrading your database to Redis version 7.2 to prevent potential application issues due to RESP3 breaking changes.

For applications using Go-Redis v9.0.5 or later, set the protocol version to RESP2:

Expand Down