Interface RedisClientConfig
-
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether automatic failover is enabled.The client name used to identify the connection.io.vertx.redis.client.RedisClientTypeThe Redis client type.Optional<io.vertx.redis.client.RedisClusterTransactions> How transactions are handled in a cluster.Whether it should set the client name while connecting with Redis.Deprecated, for removal: This API element is subject to removal in a future version.hosts()The Redis hosts to use while connecting to the Redis server.The hosts provider bean name.The master name (only considered in the Sentinel mode).intTune how much nested arrays are allowed on a Redis response.intThe maximum size of the connection pool.intThe maximum waiting requests for a connection from the pool.intSets how many handlers is the client willing to queue.password()The default password for Redis connections.The duration indicating how often should the connection pool cleaner execute.The timeout for unused connection recycling.Optional<io.vertx.redis.client.ProtocolVersion> The preferred protocol version to be used during protocol negotiation.booleanShould the client performRESPprotocol negotiation during the connection handshake.intThe number of reconnection attempts when a pooled connection cannot be established on first try.The interval between reconnection attempts when a pooled connection cannot be established on first try.Optional<io.vertx.redis.client.RedisReplicas> replicas()Whether to use replicas nodes (only considered in Cluster mode and Replication mode).Optional<io.vertx.redis.client.RedisRole> role()The role name (only considered in the Sentinel mode).tcp()TCP config.timeout()The maximum delay to wait before a blocking command to Redis server times outtls()SSL/TLS config.The name of the TLS configuration to use.default StringOptional<io.vertx.redis.client.RedisTopology> topology()How the Redis topology is obtained.The TTL of the topology cache.
-
Method Details
-
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
The hosts provider bean name.It is the
@Namedvalue 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
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
The master name (only considered in the Sentinel mode). -
role
The role name (only considered in the Sentinel mode). Accepted values are:MASTER,REPLICA,SENTINEL. -
replicas
Whether to use replicas nodes (only considered in Cluster mode and Replication mode). Accepted values are:ALWAYS,NEVER,SHARE. -
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
The duration indicating how often should the connection pool cleaner execute. -
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
The interval between reconnection attempts when a pooled connection cannot be established on first try. -
protocolNegotiation
@WithDefault("true") boolean protocolNegotiation()Should the client performRESPprotocol 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, for removal: This API element is subject to removal in a future version.usequarkus.redis.topology-cache-ttl -
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 SLOTSorSENTINEL ...).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 ofMASTERand 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
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. TheMULTIcommand 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. IfWATCHis used beforeMULTI, its key(s) determine to which node the connection is bound and the subsequentMULTIis not queued. IfWATCHkeys belong to multiple nodes, the command fails on the client side. -
tcp
TCP config. -
tls
SSL/TLS config. -
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 theRedisClientName.value()annotation.If the
configureClientName()is enabled, both this property and theRedisClientName.value()must adhere to the pattern '[a-zA-Z0-9\\-_.~]*'; if not, this may result in an incorrect client name after URI encoding. -
configureClientName
Whether it should set the client name while connecting with Redis.This is necessary because Redis only accepts
client=my-client-namequery parameter in version 6+.This property can be used with
clientName()configuration. -
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.tlswill be used.The default TLS configuration is not used by default.
-
toDebugString
-
quarkus.redis.topology-cache-ttl