-
Notifications
You must be signed in to change notification settings - Fork 259
DOC-5711 DOC-5712 DOC-5713 DOC-5714 DOC-5716 Seamless client experience docs #2120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 7 commits
baea596
6d22eed
73354b0
254b6cb
5e049f9
e5b1dfb
fab053c
66399dd
7fbc30c
2025606
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -254,3 +254,47 @@ public class Pool { | |
``` | ||
|
||
In this setup, `LettuceConnectionFactory` is a custom class you would need to implement, adhering to Apache Commons Pool's `PooledObjectFactory` interface, to manage lifecycle events of pooled `StatefulRedisConnection` objects. | ||
|
||
## Connect using Seamless client experience (SCE) | ||
|
||
*Seamless client experience (SCE)* is a feature of Redis Cloud and | ||
Redis Enterprise servers that lets them actively notify clients | ||
about planned server maintenance shortly before it happens. This | ||
lets a client take action to avoid disruptions in service. | ||
See [Seamless client experience]({{< relref "/develop/clients/sce" >}}) | ||
for more information about SCE. | ||
|
||
To enable SCE on the client, create a `MaintenanceEventsOptions` object | ||
and pass it to the `ClientOptions` builder using the `supportMaintenanceEvents()` method: | ||
|
||
```java | ||
import io.lettuce.core.*; | ||
import io.lettuce.core.api.StatefulRedisConnection; | ||
import io.lettuce.core.protocol.ProtocolVersion; | ||
. | ||
. | ||
|
||
RedisClient redisClient = RedisClient.create("redis://localhost:6379"); | ||
|
||
MaintenanceEventsOptions maintOptions = MaintenanceEventsOptions.builder() | ||
// You can also pass `false` as a parameter to `supportMaintenanceEvents()` | ||
// to explicitly disable SCE. | ||
.supportMaintenanceEvents() | ||
.build(); | ||
|
||
ClientOptions clientOptions = ClientOptions.builder() | ||
.supportMaintenanceEvents(maintOptions) | ||
.protocolVersion(ProtocolVersion.RESP3) | ||
.build(); | ||
|
||
redisClient.setOptions(clientOptions); | ||
|
||
try (StatefulRedisConnection<String, String> connection = redisClient.connect()) { | ||
. | ||
. | ||
andy-stark-redis marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
``` | ||
|
||
{{< note >}}SCE requires the [RESP3]({{< relref "/develop/reference/protocol-spec#resp-versions" >}}) | ||
|
||
protocol, so you must add the option `protocolVersion(ProtocolVersion.RESP3)` | ||
to the `ClientOptions` builder explicitly. | ||
{{< /note >}} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
categories: | ||
- docs | ||
- develop | ||
- stack | ||
- oss | ||
- rs | ||
- rc | ||
- oss | ||
- kubernetes | ||
- clients | ||
description: Learn how to avoid disruptions during Redis server maintenance. | ||
linkTitle: Seamless client experience | ||
title: Seamless client experience | ||
weight: 50 | ||
--- | ||
|
||
*Seamless client experience (SCE)* is a feature of Redis Cloud and | ||
Redis Enterprise servers that lets them actively notify clients | ||
about planned server maintenance shortly before it happens. This | ||
lets a client reconnect or otherwise respond gracefully without significant | ||
interruptions in service. | ||
|
||
SCE is primarily useful when server software or hardware is upgraded. | ||
Upgrades tend to impact the general performance of the server, so | ||
advance notification of the upgrade lets a client adjust its command | ||
timeouts to take this into account. Upgrades also involve migrating | ||
Redis shards to new nodes, which inevitably disconnects clients from | ||
existing nodes. However, with some advance warning of the disconnection, | ||
a client can buffer commands, connect to a new node, and then resume | ||
the buffered commands without aborting any of them. As a result, users | ||
see no disruption in service. | ||
|
||
## Enable SCE | ||
|
||
SCE is enabled by default on Redis Cloud, but you must enable it | ||
explicitly on Redis Enterprise servers. | ||
|
||
You must also configure SCE on the client side during connection. | ||
|
||
See the pages linked below to learn how to enable SCE for: | ||
|
||
- [redis-py]({{< relref "/develop/clients/redis-py/connect#connect-using-seamless-client-experience-sce" >}}) | ||
- [node-redis]({{< relref "/develop/clients/nodejs/connect#connect-using-seamless-client-experience-sce" >}}) | ||
- [Lettuce]({{< relref "/develop/clients/lettuce/connect#connect-using-seamless-client-experience-sce" >}}) | ||
- [go-redis]({{< relref "/develop/clients/go/connect#connect-using-seamless-client-experience-sce" >}}) |
Uh oh!
There was an error while loading. Please reload this page.