Class RedisConnectOptions
java.lang.Object
io.vertx.redis.client.RedisConnectOptions
- Direct Known Subclasses:
RedisClusterConnectOptions, RedisReplicationConnectOptions, RedisSentinelConnectOptions, RedisStandaloneConnectOptions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddConnectionString(String connectionString) Adds a connection string (endpoint) to use while connecting to the redis server.Gets the redis endpoint to useGets the list of redis endpoints to use (mostly used while connecting to a cluster)intTune how much nested arrays are allowed on a redis response.intThe client will always work on pipeline mode, this means that messages can start queueing.Get the default password for Redis connections.Returns the preferred protocol version to be used during protocol negotiation.getUser()Get the default username for Redis connections.booleanShould the client performRESPprotocol negotiation during the connection handshake.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.setMaxNestedArrays(int maxNestedArrays) Tune how much nested arrays are allowed on a redis response.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.Set the default username for Redis connections.toJson()Converts this object to JSON notation.
-
Constructor Details
-
RedisConnectOptions
public RedisConnectOptions() -
RedisConnectOptions
-
RedisConnectOptions
-
RedisConnectOptions
-
-
Method Details
-
getMaxNestedArrays
public int getMaxNestedArrays()Tune how much nested arrays are allowed on a redis response. This affects the parser performance.- Returns:
- the configured max nested arrays allowance.
-
setMaxNestedArrays
Tune how much nested arrays are allowed on a redis response. This affects the parser performance.- Parameters:
maxNestedArrays- the configured max nested arrays allowance.- Returns:
- fluent self.
-
isProtocolNegotiation
public boolean isProtocolNegotiation()Should the client performRESPprotocol negotiation during the connection handshake. 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.- Returns:
- true to perform negotiation.
-
setProtocolNegotiation
Should 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.- Parameters:
protocolNegotiation- false to disableHELLO(not recommended) unless reasons...- Returns:
- fluent self
-
getPreferredProtocolVersion
Returns 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.- Returns:
- preferred protocol version
-
setPreferredProtocolVersion
Sets 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.- Parameters:
preferredProtocolVersion- preferred protocol version- Returns:
- fluent self
-
getUser
-
setUser
Set the default username for Redis connections.- Parameters:
user- the default username- Returns:
- fluent self
-
getPassword
-
setPassword
Set the default password for Redis connections.- Parameters:
password- the default password- Returns:
- fluent self
-
getEndpoint
-
addConnectionString
Adds 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.- Parameters:
connectionString- a string URI following the scheme: redis://[username:password@][host][:port][/database]- Returns:
- fluent self.
- See Also:
-
setConnectionString
Sets a single connection string (endpoint) to use while connecting to the redis server. Will replace the previously configured connection strings.- Parameters:
connectionString- a string following the scheme: redis://[username:password@][host][:port][/[database].- Returns:
- fluent self.
- See Also:
-
getEndpoints
-
setEndpoints
Set 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.- Parameters:
endpoints- list of socket addresses.- Returns:
- fluent self.
-
getMaxWaitingHandlers
public int getMaxWaitingHandlers()The 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 returns how much handlers is the client willing to queue.- Returns:
- max allowed queued waiting handlers.
-
setMaxWaitingHandlers
The 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.- Parameters:
maxWaitingHandlers- max allowed queued waiting handlers.- Returns:
- fluent self.
-
toJson
-