File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
content/develop/clients/lettuce Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -266,7 +266,11 @@ for more information about SCH.
266266
267267To enable SCH on the client, create a ` MaintNotificationsConfig ` object
268268and/or a ` TimeoutOptions ` object
269- and pass them to the ` ClientOptions ` builder as shown in the example below:
269+ and pass them to the ` ClientOptions ` builder as shown in the example below.
270+ Note that SCH also requires the
271+ [ RESP3] ({{< relref "/develop/reference/protocol-spec#resp-versions" >}})
272+ protocol. Lettuce uses this by default, but make sure you don't set
273+ ` protocolVersion(ProtocolVersion.RESP2) ` in the ` ClientOptions ` builder.
270274
271275``` java
272276import io.lettuce.core.* ;
@@ -291,6 +295,9 @@ TimeoutOptions timeoutOptions = TimeoutOptions.builder()
291295ClientOptions clientOptions = ClientOptions . builder()
292296 .maintNotificationsConfig(maintNotificationsConfig)
293297 .timeoutOptions(timeoutOptions)
298+ // SCH requires RESP3. Don't override the default protocol version
299+ // to RESP2:
300+ // .protocolVersion(ProtocolVersion.RESP2) // <- Wrong
294301 .build();
295302
296303redisClient. setOptions(clientOptions);
You can’t perform that action at this time.
0 commit comments