Skip to content

Commit 92aff1a

Browse files
Merge pull request #1537 from redis/DOC-5194-lettuce-prod-usage
DOC-5194 updated Lettuce production usage page
2 parents afa86d5 + cec2caf commit 92aff1a

File tree

1 file changed

+32
-2
lines changed

1 file changed

+32
-2
lines changed

content/develop/clients/lettuce/produsage.md

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,26 @@ title: Production usage
1515
weight: 3
1616
---
1717

18-
The following sections explain how to handle situations that may occur
19-
in your production environment.
18+
This guide offers recommendations to get the best reliability and
19+
performance in your production environment.
20+
21+
## Checklist
22+
23+
Each item in the checklist below links to the section
24+
for a recommendation. Use the checklist icons to record your
25+
progress in implementing the recommendations.
26+
27+
{{< checklist "lettuceprodlist" >}}
28+
{{< checklist-item "#timeouts" >}}Timeouts{{< /checklist-item >}}
29+
{{< checklist-item "#cluster-topology-refresh">}}Cluster topology refresh{{< /checklist-item >}}
30+
{{< checklist-item "#dns-cache-and-redis" >}}DNS cache and Redis{{< /checklist-item >}}
31+
{{< checklist-item "#exception-handling" >}}Exception handling{{< /checklist-item >}}
32+
{{< /checklist >}}
33+
34+
## Recommendations
35+
36+
The sections below offer recommendations for your production environment. Some
37+
of them may not apply to your particular use case.
2038

2139
## Timeouts
2240

@@ -94,6 +112,7 @@ try (RedisClient client = RedisClient.create(redisURI)) {
94112
```
95113

96114
## Cluster topology refresh
115+
97116
The Redis Cluster configuration is dynamic and can change at runtime.
98117
New nodes may be added, and the primary node for a specific slot can shift.
99118
Lettuce automatically handles [MOVED]({{< relref "/operate/oss_and_stack/reference/cluster-spec#moved-redirection" >}}) and [ASK]({{< relref "/operate/oss_and_stack/reference/cluster-spec#ask-redirection" >}}) redirects, but to enhance your application's resilience, you should enable adaptive topology refreshing:
@@ -159,3 +178,14 @@ Use the following code to disable the DNS cache:
159178
java.security.Security.setProperty("networkaddress.cache.ttl","0");
160179
java.security.Security.setProperty("networkaddress.cache.negative.ttl", "0");
161180
```
181+
182+
## Exception handling
183+
184+
Redis handles many errors using return values from commands, but there
185+
are also situations where exceptions can be thrown. In production code,
186+
you should handle exceptions as they occur.
187+
188+
See the Error handling sections of the
189+
[Lettuce async](https://redis.github.io/lettuce/user-guide/async-api/#error-handling) and
190+
[Lettuce reactive](https://redis.github.io/lettuce/user-guide/reactive-api/#error-handling)
191+
API guides to learn more about handling exceptions.

0 commit comments

Comments
 (0)