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 to ClientOptions with enabled TimeoutOptions.
  • 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:
  • 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

      Optional<String> 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
    • 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 new LettuceClientConfiguration.LettuceClientConfigurationBuilder to build LettuceClientConfiguration to be used with the Lettuce client.
      Returns:
      a new LettuceClientConfiguration.LettuceClientConfigurationBuilder to build LettuceClientConfiguration.
    • defaultConfiguration

      static LettuceClientConfiguration defaultConfiguration()
      Creates a default LettuceClientConfiguration with:
      SSL
      no
      Peer Verification
      yes
      Start TLS
      no
      Client Options
      ClientOptions with enabled TimeoutOptions
      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.