Skip to content

Commit 254b6cb

Browse files
DOC-5714 Go SCE connection details
1 parent 73354b0 commit 254b6cb

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

content/develop/clients/go/connect.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,3 +126,39 @@ if err != nil {
126126
}
127127
fmt.Println("foo", val)
128128
```
129+
130+
## Connect using Seamless client experience (SCE)
131+
132+
*Seamless client experience (SCE)* is a feature of Redis Cloud and
133+
Redis Enterprise servers that lets them actively notify clients
134+
about planned server maintenance shortly before it happens. This
135+
lets a client take action to avoid disruptions in service.
136+
See [Seamless client experience]({{< relref "/develop/clients/sce" >}})
137+
for more information about SCE.
138+
139+
To enable SCE on the client, add the `HitlessUpgrades` option during the
140+
connection, as shown in the following example:
141+
142+
```go
143+
rdb := redis.NewClient(&redis.Options{
144+
Addr: "localhost:6379",
145+
Protocol: 3, // RESP3 required
146+
HitlessUpgrades: &hitless.Config{
147+
Mode: hitless.MaintNotificationsEnabled,
148+
RelaxedTimeout: 10 * time.Second,
149+
},
150+
})
151+
```
152+
153+
{{< note >}}SCE requires the [RESP3]({{< relref "/develop/reference/protocol-spec#resp-versions" >}})
154+
protocol, so you must set `Protocol:3` explicitly when you connect.
155+
{{< /note >}}
156+
157+
The `hitless.Config` object accepts the following parameters:
158+
159+
| Name | Description |
160+
|------ |------------- |
161+
| `Mode` | Whether or not to enable SCE. The options are `hitless.MaintNotificationsDisabled`, `hitless.MaintNotificationsEnabled` (require SCE and abort the connection if not supported), and `hitless.MaintNotificationsAuto` (require SCE and fall back to a non-SCE connection if not supported). The default is `hitless.MaintNotificationsAuto`. |
162+
| `RelaxedTimeout` | The timeout to use for commands and connections while the server is performing maintenance. The default is 10 seconds. |
163+
| `HandoffTimeout` | The timeout to connect to the replacement node. The default is 15 seconds. |
164+
| `MaxHandoffRetries` | The maximum number of times to retry connecting to the replacement node. The default is 3. |

0 commit comments

Comments
 (0)