public class RedisSentinelConnectOptions extends RedisConnectOptions
Constructor and Description |
---|
RedisSentinelConnectOptions() |
RedisSentinelConnectOptions(JsonObject json) |
RedisSentinelConnectOptions(RedisOptions options) |
RedisSentinelConnectOptions(RedisSentinelConnectOptions other) |
Modifier and Type | Method and Description |
---|---|
String |
getMasterName()
Get the master name (only considered in HA mode).
|
RedisRole |
getRole()
Get the role name (only considered in HA mode).
|
RedisSentinelConnectOptions |
setConnectionString(String connectionString)
Sets a single connection string (endpoint) to use while connecting to the redis server.
|
RedisSentinelConnectOptions |
setEndpoints(List<String> endpoints)
Set the endpoints to use while connecting to the redis server.
|
RedisConnectOptions |
setMasterName(String masterName)
Set the master name (only considered in HA mode).
|
RedisSentinelConnectOptions |
setMaxNestedArrays(int maxNestedArrays)
Tune how much nested arrays are allowed on a redis response.
|
RedisSentinelConnectOptions |
setMaxWaitingHandlers(int maxWaitingHandlers)
The client will always work on pipeline mode, this means that messages can start queueing.
|
RedisSentinelConnectOptions |
setPassword(String password)
Set the default password for cluster/sentinel connections.
|
RedisSentinelConnectOptions |
setProtocolNegotiation(boolean protocolNegotiation)
Should the client perform
REST protocol negotiation during the connection acquire. |
RedisConnectOptions |
setRole(RedisRole role)
Set the role name (only considered in HA mode).
|
JsonObject |
toJson()
Converts this object to JSON notation.
|
addConnectionString, getEndpoint, getEndpoints, getMaxNestedArrays, getMaxWaitingHandlers, getPassword, isProtocolNegotiation
public RedisSentinelConnectOptions(RedisOptions options)
public RedisSentinelConnectOptions()
public RedisSentinelConnectOptions(RedisSentinelConnectOptions other)
public RedisSentinelConnectOptions(JsonObject json)
public RedisRole getRole()
public RedisConnectOptions setRole(RedisRole role)
role
- the master name.public String getMasterName()
public RedisConnectOptions setMasterName(String masterName)
masterName
- the master name.public RedisSentinelConnectOptions setMaxNestedArrays(int maxNestedArrays)
RedisConnectOptions
setMaxNestedArrays
in class RedisConnectOptions
maxNestedArrays
- the configured max nested arrays allowance.public RedisSentinelConnectOptions setProtocolNegotiation(boolean protocolNegotiation)
RedisConnectOptions
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.setProtocolNegotiation
in class RedisConnectOptions
protocolNegotiation
- false to disable HELLO
(not recommended) unless reasons...public RedisSentinelConnectOptions setPassword(String password)
RedisConnectOptions
setPassword
in class RedisConnectOptions
password
- the default passwordpublic RedisSentinelConnectOptions setEndpoints(List<String> endpoints)
RedisConnectOptions
setEndpoints
in class RedisConnectOptions
endpoints
- list of socket addresses.public RedisSentinelConnectOptions setConnectionString(String connectionString)
RedisConnectOptions
setConnectionString
in class RedisConnectOptions
connectionString
- a string following the scheme: redis://[username:password@][host][:port][/[database].public RedisSentinelConnectOptions setMaxWaitingHandlers(int maxWaitingHandlers)
RedisConnectOptions
setMaxWaitingHandlers
in class RedisConnectOptions
maxWaitingHandlers
- max allowed queued waiting handlers.public JsonObject toJson()
toJson
in class RedisConnectOptions
Copyright © 2024 Eclipse. All rights reserved.