public abstract class RedisConnectOptions extends Object
Constructor and Description |
---|
RedisConnectOptions() |
RedisConnectOptions(JsonObject json) |
RedisConnectOptions(RedisConnectOptions other) |
RedisConnectOptions(RedisOptions options) |
Modifier and Type | Method and Description |
---|---|
RedisConnectOptions |
addConnectionString(String connectionString)
Adds a connection string (endpoint) to use while connecting to the redis server.
|
String |
getEndpoint()
Gets the redis endpoint to use
|
List<String> |
getEndpoints()
Gets the list of redis endpoints to use (mostly used while connecting to a cluster)
|
int |
getMaxNestedArrays()
Tune how much nested arrays are allowed on a redis response.
|
int |
getMaxWaitingHandlers()
The client will always work on pipeline mode, this means that messages can start queueing.
|
String |
getPassword()
Get the default password for cluster/sentinel connections, if not set it will try to
extract it from the current default endpoint.
|
boolean |
isProtocolNegotiation()
Should the client perform
RESP protocol negotiation during the connection handshake. |
RedisConnectOptions |
setConnectionString(String connectionString)
Sets a single connection string (endpoint) to use while connecting to the redis server.
|
RedisConnectOptions |
setEndpoints(List<String> endpoints)
Set the endpoints to use while connecting to the redis server.
|
RedisConnectOptions |
setMaxNestedArrays(int maxNestedArrays)
Tune how much nested arrays are allowed on a redis response.
|
RedisConnectOptions |
setMaxWaitingHandlers(int maxWaitingHandlers)
The client will always work on pipeline mode, this means that messages can start queueing.
|
RedisConnectOptions |
setPassword(String password)
Set the default password for cluster/sentinel connections.
|
RedisConnectOptions |
setProtocolNegotiation(boolean protocolNegotiation)
Should the client perform
REST protocol negotiation during the connection acquire. |
JsonObject |
toJson()
Converts this object to JSON notation.
|
public RedisConnectOptions(RedisOptions options)
public RedisConnectOptions()
public RedisConnectOptions(RedisConnectOptions other)
public RedisConnectOptions(JsonObject json)
public int getMaxNestedArrays()
public RedisConnectOptions setMaxNestedArrays(int maxNestedArrays)
maxNestedArrays
- the configured max nested arrays allowance.public boolean isProtocolNegotiation()
RESP
protocol negotiation during the connection handshake.
By default this is true
, but there are situations when using broken servers it may
be useful to skip this and always fallback to RESP2
without using the HELLO
command.public RedisConnectOptions setProtocolNegotiation(boolean protocolNegotiation)
REST
protocol negotiation during the connection acquire.
By default this is true
, but there are situations when using broken servers it may
be useful to skip this and always fallback to RESP2
without using the HELLO
command.protocolNegotiation
- false to disable HELLO
(not recommended) unless reasons...public String getPassword()
public RedisConnectOptions setPassword(String password)
password
- the default passwordpublic List<String> getEndpoints()
public String getEndpoint()
public RedisConnectOptions setEndpoints(List<String> endpoints)
endpoints
- list of socket addresses.public RedisConnectOptions addConnectionString(String connectionString)
connectionString
- a string URI following the scheme: redis://[username:password@][host][:port][/database]public RedisConnectOptions setConnectionString(String connectionString)
connectionString
- a string following the scheme: redis://[username:password@][host][:port][/[database].public int getMaxWaitingHandlers()
public RedisConnectOptions setMaxWaitingHandlers(int maxWaitingHandlers)
maxWaitingHandlers
- max allowed queued waiting handlers.public JsonObject toJson()
Copyright © 2024 Eclipse. All rights reserved.