From faccd04a1111d2c1bb7328634a2d3cb7229edd9e Mon Sep 17 00:00:00 2001 From: Andy Stark Date: Thu, 22 Aug 2024 10:15:33 +0100 Subject: [PATCH] DOC-4167 update Lettuce links and basic info --- .../develop/connect/clients/java/_index.md | 2 +- content/develop/connect/clients/java/jedis.md | 4 ++-- .../develop/connect/clients/java/lettuce.md | 20 +++++++++++-------- content/embeds/r7.2-migration-guides.md | 2 +- .../rs/references/compatibility/resp.md | 2 +- .../rs-7-2-4-releases/rs-7-2-4-52.md | 4 ++-- 6 files changed, 19 insertions(+), 15 deletions(-) diff --git a/content/develop/connect/clients/java/_index.md b/content/develop/connect/clients/java/_index.md index d130e5ae9a..da7dd82898 100644 --- a/content/develop/connect/clients/java/_index.md +++ b/content/develop/connect/clients/java/_index.md @@ -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" >}}) diff --git a/content/develop/connect/clients/java/jedis.md b/content/develop/connect/clients/java/jedis.md index 13f36cc097..b1465a9c1c 100644 --- a/content/develop/connect/clients/java/jedis.md +++ b/content/develop/connect/clients/java/jedis.md @@ -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. diff --git a/content/develop/connect/clients/java/lettuce.md b/content/develop/connect/clients/java/lettuce.md index 342906b23b..9636dd7655 100644 --- a/content/develop/connect/clients/java/lettuce.md +++ b/content/develop/connect/clients/java/lettuce.md @@ -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. @@ -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 @@ -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 @@ -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. @@ -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. @@ -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/) diff --git a/content/embeds/r7.2-migration-guides.md b/content/embeds/r7.2-migration-guides.md index c3654ce5df..34aef8e30b 100644 --- a/content/embeds/r7.2-migration-guides.md +++ b/content/embeds/r7.2-migration-guides.md @@ -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 diff --git a/content/operate/rs/references/compatibility/resp.md b/content/operate/rs/references/compatibility/resp.md index 9a3c39ea4b..5cd35378a4 100644 --- a/content/operate/rs/references/compatibility/resp.md +++ b/content/operate/rs/references/compatibility/resp.md @@ -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 diff --git a/content/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-52.md b/content/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-52.md index a750a5a2c3..ac25a6daa7 100644 --- a/content/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-52.md +++ b/content/operate/rs/release-notes/rs-7-2-4-releases/rs-7-2-4-52.md @@ -127,7 +127,7 @@ To use RESP3 with Redis Enterprise: rladmin tune db db: 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 @@ -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: