Interface RedisClientConfig


public interface RedisClientConfig
  • Method Details

    • hosts

      Optional<Set<URI>> hosts()
      The Redis hosts to use while connecting to the Redis server. Only the cluster and sentinel modes will consider more than 1 element.

      The URI provided uses the following schema `redis://[username:password@][host][:port][/database]` Use `quarkus.redis.hosts-provider-name` to provide the hosts programmatically.

      See Also:
    • hostsProviderName

      Optional<String> hostsProviderName()
      The hosts provider bean name.

      It is the &#64;Named value of the hosts provider bean. It is used to discriminate if multiple `io.quarkus.redis.client.RedisHostsProvider` beans are available.

      Used when `quarkus.redis.hosts` is not set.

    • timeout

      @WithDefault("10s") Duration timeout()
      The maximum delay to wait before a blocking command to Redis server times out
    • clientType

      @WithDefault("standalone") io.vertx.redis.client.RedisClientType clientType()
      The Redis client type. Accepted values are: STANDALONE (default), CLUSTER, REPLICATION, SENTINEL.
    • masterName

      @ConfigDocDefault("mymaster") Optional<String> masterName()
      The master name (only considered in the Sentinel mode).
    • role

      @ConfigDocDefault("master") Optional<io.vertx.redis.client.RedisRole> role()
      The role name (only considered in the Sentinel mode). Accepted values are: MASTER, REPLICA, SENTINEL.
    • replicas

      @ConfigDocDefault("never") Optional<io.vertx.redis.client.RedisReplicas> replicas()
      Whether to use replicas nodes (only considered in Cluster mode and Replication mode). Accepted values are: ALWAYS, NEVER, SHARE.
    • password

      Optional<String> password()
      The default password for Redis connections.

      If not set, it will try to extract the value from the hosts.

    • maxPoolSize

      @WithDefault("6") int maxPoolSize()
      The maximum size of the connection pool.
    • maxPoolWaiting

      @WithDefault("24") int maxPoolWaiting()
      The maximum waiting requests for a connection from the pool.
    • poolCleanerInterval

      @ConfigDocDefault("30s") Optional<Duration> poolCleanerInterval()
      The duration indicating how often should the connection pool cleaner execute.
    • poolRecycleTimeout

      @WithDefault("3m") Optional<Duration> poolRecycleTimeout()
      The timeout for unused connection recycling.
    • maxWaitingHandlers

      @WithDefault("2048") int maxWaitingHandlers()
      Sets how many handlers is the client willing to queue.

      The client will always work on pipeline mode, this means that messages can start queueing. Using this configuration option, you can control how much backlog you're willing to accept.

    • maxNestedArrays

      @WithDefault("32") int maxNestedArrays()
      Tune how much nested arrays are allowed on a Redis response. This affects the parser performance.
    • reconnectAttempts

      @WithDefault("0") int reconnectAttempts()
      The number of reconnection attempts when a pooled connection cannot be established on first try.
    • reconnectInterval

      @WithDefault("1") Duration reconnectInterval()
      The interval between reconnection attempts when a pooled connection cannot be established on first try.
    • protocolNegotiation

      @WithDefault("true") boolean protocolNegotiation()
      Should the client perform RESP protocol negotiation during the connection handshake.
    • preferredProtocolVersion

      @ConfigDocDefault("resp3") Optional<io.vertx.redis.client.ProtocolVersion> preferredProtocolVersion()
      The preferred protocol version to be used during protocol negotiation. When not set, defaults to RESP 3. When protocol negotiation is disabled, this setting has no effect.
    • hashSlotCacheTtl

      @Deprecated(forRemoval=true, since="3.30") @WithDefault("1s") Duration hashSlotCacheTtl()
      Deprecated, for removal: This API element is subject to removal in a future version.
      use quarkus.redis.topology-cache-ttl
    • topologyCacheTtl

      @WithDefault("1s") Optional<Duration> topologyCacheTtl()
      The TTL of the topology cache. A topology cache is used by a clustered Redis client and a sentinel Redis client to prevent constantly sending topology discovery commands (CLUSTER SLOTS or SENTINEL ...).

      This setting is only meaningful in case of a clustered Redis client and a sentinel Redis client and has no effect otherwise.

    • autoFailover

      @WithDefault("false") boolean autoFailover()
      Whether automatic failover is enabled. This only makes sense for sentinel clients with role of MASTER and is ignored otherwise.

      If enabled, the sentinel client will additionally create a connection to one sentinel node and watch for failover events. When new master is elected, all connections to the old master are automatically closed and new connections to the new master are created. Automatic failover makes sense for connections executing regular commands, but not for connections used to subscribe to Redis pub/sub channels.

      Note that there is a brief period of time between the old master failing and the new master being elected when the existing connections will temporarily fail all operations. After the new master is elected, the connections will automatically fail over and start working again.

    • topology

      @ConfigDocDefault("discover") Optional<io.vertx.redis.client.RedisTopology> topology()
      How the Redis topology is obtained. By default, the topology is discovered automatically. This is the only mode for the clustered and sentinel client. For replication client, topology may be set statically.

      In case of a static topology for replication Redis client, the first node in the list is considered a master and the remaining nodes in the list are considered replicas.

    • clusterTransactions

      @ConfigDocDefault("disabled") Optional<io.vertx.redis.client.RedisClusterTransactions> clusterTransactions()
      How transactions are handled in a cluster. This only makes sense for cluster clients and is ignored otherwise.

      By default, transactions in cluster are disabled and transaction commands fail.

      When set to single-node, Redis transactions are supported in the cluster, but only when they target a single node. The MULTI command is queued and is only issued when the next command is executed. This next command binds the connection to the corresponding node of the Redis cluster (so it should have keys, otherwise the target node is random). All subsequent commands are targeted to that node. If some of the subsequent commands have a key that belongs to another node, the command will fail on the server side. If WATCH is used before MULTI, its key(s) determine to which node the connection is bound and the subsequent MULTI is not queued. If WATCH keys belong to multiple nodes, the command fails on the client side.

    • tcp

      @ConfigDocSection NetConfig tcp()
      TCP config.
    • tls

      @ConfigDocSection TlsConfig tls()
      SSL/TLS config.
    • clientName

      Optional<String> clientName()
      The client name used to identify the connection.

      If the configureClientName() is enabled, and this property is not set it will attempt to extract the value from the RedisClientName.value() annotation.

      If the configureClientName() is enabled, both this property and the RedisClientName.value() must adhere to the pattern '[a-zA-Z0-9\\-_.~]*'; if not, this may result in an incorrect client name after URI encoding.

    • configureClientName

      @WithDefault("false") Boolean configureClientName()
      Whether it should set the client name while connecting with Redis.

      This is necessary because Redis only accepts client=my-client-name query parameter in version 6+.

      This property can be used with clientName() configuration.

    • tlsConfigurationName

      Optional<String> tlsConfigurationName()
      The name of the TLS configuration to use.

      If a name is configured, it uses the configuration from quarkus.tls.<name>.* If a name is configured, but no TLS configuration is found with that name then an error will be thrown.

      If no TLS configuration name is set then, quarkus.redis.$client-name.tls will be used.

      The default TLS configuration is not used by default.

    • toDebugString

      default String toDebugString()