Class RedisClusterConnectOptions
java.lang.Object
io.vertx.redis.client.RedisConnectOptions
io.vertx.redis.client.RedisClusterConnectOptions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddClientIdSuffix(String clientIdSuffix) Adds a single framework suffix appended to the reportedlib-name.addConnectionString(String connectionString) Adds a connection string (endpoint) to use while connecting to the redis server.Get how Redis transactions are handled in cluster mode.longDeprecated.longReturns the TTL of the topology cache.Get whether to use replica nodes for read only queries.setClientId(boolean clientId) Sets whether the client identifies itself to the server after the handshake usingCLIENT SETINFO(Redis 7.2+).setClientIdSuffixes(List<String> clientIdSuffixes) Sets the framework suffixes appended to the reportedlib-name.setClusterTransactions(RedisClusterTransactions clusterTransactions) Set how Redis transactions are handled in cluster mode.setConnectionString(String connectionString) Sets a single connection string (endpoint) to use while connecting to the redis server.setEndpoints(List<String> endpoints) Set the endpoints to use while connecting to the redis server.setHashSlotCacheTTL(long hashSlotCacheTTL) Deprecated.setMaxLineLength(int maxLineLength) Set the maximum length (in bytes) of a single RESP line (a simple string, an error, or a type header) that may be buffered before its\r\nterminator is found.setMaxMultiLength(int maxMultiLength) Set the maximum number of elements allowed in any single RESP multi-bulk response (array, map, set, push, attribute).setMaxNestedArrays(int maxNestedArrays) Tune how much nested arrays are allowed on a redis response.setMaxStringLength(long maxStringLength) Set the maximum length (in bytes) of a single RESP bulk (bulk string or verbatim string) payload.setMaxWaitingHandlers(int maxWaitingHandlers) The client will always work on pipeline mode, this means that messages can start queueing.setPassword(String password) Set the default password for Redis connections.setPreferredProtocolVersion(ProtocolVersion preferredProtocolVersion) Sets the preferred protocol version to be used during protocol negotiation.setProtocolNegotiation(boolean protocolNegotiation) Should the client performRESTprotocol negotiation during the connection acquire.setTopologyCacheTTL(long topologyCacheTTL) Sets the TTL of the hash slot cache.Set the default username for Redis connections.setUseReplicas(RedisReplicas useReplicas) Set whether to use replica nodes for read only queries.toJson()Converts this object to JSON notation.
-
Constructor Details
-
RedisClusterConnectOptions
public RedisClusterConnectOptions() -
RedisClusterConnectOptions
-
RedisClusterConnectOptions
-
RedisClusterConnectOptions
-
-
Method Details
-
getUseReplicas
Get whether to use replica nodes for read only queries.- Returns:
- the cluster replica node use mode.
-
setUseReplicas
Set whether to use replica nodes for read only queries.- Parameters:
useReplicas- the cluster replica use mode.- Returns:
- fluent self.
-
getHashSlotCacheTTL
Deprecated. -
getTopologyCacheTTL
public long getTopologyCacheTTL()Returns the TTL of the topology cache. The TTL is expressed in milliseconds. Defaults to 1000 millis (1 second).- Returns:
- the TTL of the topology cache
-
setHashSlotCacheTTL
Deprecated. -
setTopologyCacheTTL
Sets the TTL of the hash slot cache. The TTL is expressed in milliseconds. Defaults to 1000 millis (1 second).- Parameters:
topologyCacheTTL- the TTL of the hash slot cache, in millis
-
getClusterTransactions
Get how Redis transactions are handled in cluster mode.- Returns:
- how transactions are handled
-
setClusterTransactions
public RedisClusterConnectOptions setClusterTransactions(RedisClusterTransactions clusterTransactions) Set how Redis transactions are handled in cluster mode.- Parameters:
clusterTransactions- transaction handling mode- Returns:
- fluent self
-
setMaxNestedArrays
Description copied from class:RedisConnectOptionsTune how much nested arrays are allowed on a redis response. This affects the parser performance.- Overrides:
setMaxNestedArraysin classRedisConnectOptions- Parameters:
maxNestedArrays- the configured max nested arrays allowance.- Returns:
- fluent self.
-
setMaxMultiLength
Description copied from class:RedisConnectOptionsSet the maximum number of elements allowed in any single RESP multi-bulk response (array, map, set, push, attribute). Responses exceeding this limit cause the connection to be closed with an error. The default value is 65535.Users with legitimate large responses (e.g. large
LRANGE) can increase this value.- Overrides:
setMaxMultiLengthin classRedisConnectOptions- Parameters:
maxMultiLength- the maximum multi-bulk length.- Returns:
- fluent self.
-
setMaxLineLength
Description copied from class:RedisConnectOptionsSet the maximum length (in bytes) of a single RESP line (a simple string, an error, or a type header) that may be buffered before its\r\nterminator is found. Lines exceeding this limit cause the connection to be closed with an error. The default value is 128 KB.- Overrides:
setMaxLineLengthin classRedisConnectOptions- Parameters:
maxLineLength- the maximum line length, in bytes.- Returns:
- fluent self.
-
setMaxStringLength
Description copied from class:RedisConnectOptionsSet the maximum length (in bytes) of a single RESP bulk (bulk string or verbatim string) payload. Responses exceeding this limit cause the connection to be closed with an error. The default value is 512 MB.- Overrides:
setMaxStringLengthin classRedisConnectOptions- Parameters:
maxStringLength- the maximum string length, in bytes.- Returns:
- fluent self.
-
setProtocolNegotiation
Description copied from class:RedisConnectOptionsShould the client performRESTprotocol negotiation during the connection acquire. By default this istrue, but there are situations when using broken servers it may be useful to skip this and always fallback toRESP2without using theHELLOcommand.- Overrides:
setProtocolNegotiationin classRedisConnectOptions- Parameters:
protocolNegotiation- false to disableHELLO(not recommended) unless reasons...- Returns:
- fluent self
-
setPreferredProtocolVersion
public RedisClusterConnectOptions setPreferredProtocolVersion(ProtocolVersion preferredProtocolVersion) Description copied from class:RedisConnectOptionsSets 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.- Overrides:
setPreferredProtocolVersionin classRedisConnectOptions- Parameters:
preferredProtocolVersion- preferred protocol version- Returns:
- fluent self
-
setUser
Description copied from class:RedisConnectOptionsSet the default username for Redis connections.- Overrides:
setUserin classRedisConnectOptions- Parameters:
user- the default username- Returns:
- fluent self
-
setPassword
Description copied from class:RedisConnectOptionsSet the default password for Redis connections.- Overrides:
setPasswordin classRedisConnectOptions- Parameters:
password- the default password- Returns:
- fluent self
-
setEndpoints
Description copied from class:RedisConnectOptionsSet the endpoints to use while connecting to the redis server. Only the cluster mode will consider more than 1 element. If more are provided, they are not considered by the client when in single server mode.- Overrides:
setEndpointsin classRedisConnectOptions- Parameters:
endpoints- list of socket addresses.- Returns:
- fluent self.
-
addConnectionString
Description copied from class:RedisConnectOptionsAdds a connection string (endpoint) to use while connecting to the redis server. Only the cluster mode will consider more than 1 element. If more are provided, they are not considered by the client when in single server mode.- Overrides:
addConnectionStringin classRedisConnectOptions- Parameters:
connectionString- a string URI following the scheme: redis://[username:password@][host][:port][/database]- Returns:
- fluent self.
- See Also:
-
setConnectionString
Description copied from class:RedisConnectOptionsSets a single connection string (endpoint) to use while connecting to the redis server. Will replace the previously configured connection strings.- Overrides:
setConnectionStringin classRedisConnectOptions- Parameters:
connectionString- a string following the scheme: redis://[username:password@][host][:port][/[database].- Returns:
- fluent self.
- See Also:
-
setMaxWaitingHandlers
Description copied from class:RedisConnectOptionsThe client will always work on pipeline mode, this means that messages can start queueing. You can control how much backlog you're willing to accept. This methods sets how much handlers is the client willing to queue.- Overrides:
setMaxWaitingHandlersin classRedisConnectOptions- Parameters:
maxWaitingHandlers- max allowed queued waiting handlers.- Returns:
- fluent self.
-
setClientId
Description copied from class:RedisConnectOptionsSets whether the client identifies itself to the server after the handshake usingCLIENT SETINFO(Redis 7.2+). Disabling this skips the identification commands entirely.- Overrides:
setClientIdin classRedisConnectOptions- Parameters:
clientId- false to disable self-identification.- Returns:
- fluent self.
-
setClientIdSuffixes
Description copied from class:RedisConnectOptionsSets the framework suffixes appended to the reportedlib-name. The composed name has the formvertx-redis-client(suffix1;suffix2). Suffixes must consist of printable ASCII characters and must not contain(,)or;.- Overrides:
setClientIdSuffixesin classRedisConnectOptions- Parameters:
clientIdSuffixes- the library suffixes, may benullto report only the base name.- Returns:
- fluent self.
-
addClientIdSuffix
Description copied from class:RedisConnectOptionsAdds a single framework suffix appended to the reportedlib-name.- Overrides:
addClientIdSuffixin classRedisConnectOptions- Parameters:
clientIdSuffix- the library suffix, must consist of printable ASCII characters and must not contain(,)or;.- Returns:
- fluent self.
-
toJson
Converts this object to JSON notation.- Overrides:
toJsonin classRedisConnectOptions- Returns:
- JSON
-