Interface LettuceClientConfiguration
- All Known Subinterfaces:
LettucePoolingClientConfiguration
public interface LettuceClientConfiguration
Redis client configuration for lettuce. This configuration provides optional configuration elements such as
ClientResources and ClientOptions specific to Lettuce client features.
Providing optional elements allows a more specific configuration of the client:
- Whether to use SSL
- Whether to verify peers using SSL
- Whether to use StartTLS
- Optional
ClientResources - Optional
ClientOptions, defaults toClientOptionswith enabledTimeoutOptions. - Optional client name
- Optional
ReadFrom. Enables Master/Replica operations if configured. - Client
timeout - Shutdown
timeout - Shutdown quiet
period
- Since:
- 2.0
- Author:
- Mark Paluch, Christoph Strobl, Yanming Zhou
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classstatic classBuilder for SSL-relatedLettuceClientConfiguration. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a newLettuceClientConfiguration.LettuceClientConfigurationBuilderto buildLettuceClientConfigurationto be used with the Lettuce client.static LettuceClientConfigurationCreates a defaultLettuceClientConfigurationwith: SSL no Peer Verification yes Start TLS no Client OptionsClientOptionswith enabledTimeoutOptionsClient Resources none Client name none Read From none Connect Timeout 60 Seconds Shutdown Timeout 100 Milliseconds Shutdown Quiet Period 100 MillisecondsOptional<io.lettuce.core.ClientOptions>Optional<io.lettuce.core.resource.ClientResources>Optional<io.lettuce.core.ReadFrom>booleanbooleanisUseSsl()boolean
-
Method Details
-
isUseSsl
boolean isUseSsl()- Returns:
- true to use SSL, false to use unencrypted connections.
-
isVerifyPeer
boolean isVerifyPeer()- Returns:
- true to verify peers when using
SSL.
-
isStartTls
boolean isStartTls()- Returns:
- true to use Start TLS (
trueif the first write request shouldn't be encrypted).
-
getClientResources
Optional<io.lettuce.core.resource.ClientResources> getClientResources()- Returns:
- the optional
ClientResources.
-
getClientOptions
Optional<io.lettuce.core.ClientOptions> getClientOptions()- Returns:
- the optional
ClientOptions.
-
getClientName
- Returns:
- the optional client name to be set with
CLIENT SETNAME. - Since:
- 2.1
-
getReadFrom
Optional<io.lettuce.core.ReadFrom> getReadFrom()- Returns:
- the optional
ReadFromsetting. - Since:
- 2.1
-
getRedisCredentialsProviderFactory
Optional<RedisCredentialsProviderFactory> getRedisCredentialsProviderFactory()- Returns:
- the optional
RedisCredentialsProviderFactory. - Since:
- 3.0
-
getCommandTimeout
Duration getCommandTimeout()- Returns:
- the timeout.
-
getShutdownTimeout
Duration getShutdownTimeout()- Returns:
- the shutdown timeout used to close the client.
- See Also:
-
AbstractRedisClient.shutdown(long, long, TimeUnit)
-
getShutdownQuietPeriod
Duration getShutdownQuietPeriod()- Returns:
- the shutdown quiet period used to close the client.
- Since:
- 2.2
- See Also:
-
AbstractRedisClient.shutdown(long, long, TimeUnit)
-
builder
Creates a newLettuceClientConfiguration.LettuceClientConfigurationBuilderto buildLettuceClientConfigurationto be used with the Lettuce client.- Returns:
- a new
LettuceClientConfiguration.LettuceClientConfigurationBuilderto buildLettuceClientConfiguration.
-
defaultConfiguration
Creates a defaultLettuceClientConfigurationwith:- SSL
- no
- Peer Verification
- yes
- Start TLS
- no
- Client Options
ClientOptionswith enabledTimeoutOptions- Client Resources
- none
- Client name
- none
- Read From
- none
- Connect Timeout
- 60 Seconds
- Shutdown Timeout
- 100 Milliseconds
- Shutdown Quiet Period
- 100 Milliseconds
- Returns:
- a
LettuceClientConfigurationwith defaults.
-