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 toClientOptions
with 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
Modifier and TypeInterfaceDescriptionstatic class
static class
Builder for SSL-relatedLettuceClientConfiguration
. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a newLettuceClientConfiguration.LettuceClientConfigurationBuilder
to buildLettuceClientConfiguration
to be used with the Lettuce client.static LettuceClientConfiguration
Creates a defaultLettuceClientConfiguration
with: SSL no Peer Verification yes Start TLS no Client OptionsClientOptions
with enabledTimeoutOptions
Client 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>
boolean
boolean
isUseSsl()
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 (
true
if 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
ReadFrom
setting. - 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.LettuceClientConfigurationBuilder
to buildLettuceClientConfiguration
to be used with the Lettuce client.- Returns:
- a new
LettuceClientConfiguration.LettuceClientConfigurationBuilder
to buildLettuceClientConfiguration
.
-
defaultConfiguration
Creates a defaultLettuceClientConfiguration
with:- SSL
- no
- Peer Verification
- yes
- Start TLS
- no
- Client Options
ClientOptions
with 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
LettuceClientConfiguration
with defaults.
-