public class RedisOptions extends NetClientOptions
* `encoding`: `UTF-8` * `host`: `localhost` * `port`: 6379 * `tcpKeepAlive`: true * `tcpNoDelay`: true * `binary`: false
However there are two extra properties that have no defaults since they are optional:
* `auth` * `select`
The usage of this two extra properties is to setup required authentication and optionally the selection of the active
database at connection time. If you define this extra properties on every connection to Redis server this client
will perform the authentication handshake and database selection, however if you don't do this and call RedisClient.auth(String, Handler)
yourself in case of connection failure the client will not be able to perform the correct authentication handshake.
DEFAULT_HOSTNAME_VERIFICATION_ALGORITHM, DEFAULT_RECONNECT_ATTEMPTS, DEFAULT_RECONNECT_INTERVAL
DEFAULT_CONNECT_TIMEOUT, DEFAULT_METRICS_NAME, DEFAULT_TRUST_ALL
DEFAULT_IDLE_TIMEOUT, DEFAULT_SO_LINGER, DEFAULT_SSL, DEFAULT_SSL_ENGINE, DEFAULT_TCP_KEEP_ALIVE, DEFAULT_TCP_NO_DELAY, DEFAULT_USE_ALPN, DEFAULT_USE_POOLED_BUFFERS
DEFAULT_LOG_ENABLED, DEFAULT_RECEIVE_BUFFER_SIZE, DEFAULT_REUSE_ADDRESS, DEFAULT_SEND_BUFFER_SIZE, DEFAULT_TRAFFIC_CLASS
Constructor and Description |
---|
RedisOptions() |
RedisOptions(JsonObject json) |
RedisOptions(RedisOptions other) |
Modifier and Type | Method and Description |
---|---|
RedisOptions |
addSentinel(String sentinelHostAndPort)
Add Sentinel node.
|
String |
getAddress()
Get the default `PUB/SUB` eventbus address prefix, default `io.vertx.redis`.
|
String |
getAuth()
Get the password for authentication at connection time.
|
String |
getEncoding()
Return the character encoding for Strings, default `UTF-8`.
|
String |
getHost()
Get the host name for the Redis server, default `localhost`.
|
String |
getMasterName()
Get name of Redis master.
|
int |
getPort()
Get the tcp port where the Redis server is listening, default 6379.
|
Integer |
getSelect()
Get the database to select at connection time.
|
List<String> |
getSentinels()
Get list of Sentinels.
|
boolean |
isBinary()
Return if the messages to/from redis are binary, default `false`.
|
RedisOptions |
setAddress(String address)
Set the eventbus address prefix for `PUB/SUB`.
|
RedisOptions |
setAuth(String auth)
Set the password for authentication at connection time.
|
RedisOptions |
setBinary(boolean binary)
Set the user defined character encoding, e.g.: `iso-8859-1`.
|
RedisOptions |
setEncoding(String encoding)
Set the user defined character encoding, e.g.: `iso-8859-1`.
|
RedisOptions |
setHost(String host)
Set the host name where the Redis server is listening.
|
RedisOptions |
setMasterName(String masterName)
Set name of Redis master (used with Sentinel).
|
RedisOptions |
setPort(int port)
Set the tcp port where the Redis server is listening.
|
RedisOptions |
setSelect(Integer select)
Set the database to select at connection time.
|
RedisOptions |
setSentinels(List<String> sentinels)
Set the list of Sentinels.
|
addCrlPath, addCrlValue, addEnabledCipherSuite, addEnabledSecureTransportProtocol, equals, getHostnameVerificationAlgorithm, getReconnectAttempts, getReconnectInterval, hashCode, setConnectTimeout, setHostnameVerificationAlgorithm, setIdleTimeout, setKeyCertOptions, setKeyStoreOptions, setLocalAddress, setLogActivity, setMetricsName, setPemKeyCertOptions, setPemTrustOptions, setPfxKeyCertOptions, setPfxTrustOptions, setProxyOptions, setReceiveBufferSize, setReconnectAttempts, setReconnectInterval, setReuseAddress, setSendBufferSize, setSoLinger, setSsl, setTcpKeepAlive, setTcpNoDelay, setTrafficClass, setTrustAll, setTrustOptions, setTrustStoreOptions, setUsePooledBuffers
getConnectTimeout, getLocalAddress, getMetricsName, getProxyOptions, isTrustAll, setJdkSslEngineOptions, setOpenSslEngineOptions, setSslEngineOptions, setUseAlpn, toJson
getCrlPaths, getCrlValues, getEnabledCipherSuites, getEnabledSecureTransportProtocols, getIdleTimeout, getJdkSslEngineOptions, getKeyCertOptions, getKeyStoreOptions, getOpenSslEngineOptions, getPemKeyCertOptions, getPemTrustOptions, getPfxKeyCertOptions, getPfxTrustOptions, getSoLinger, getSslEngineOptions, getTrustOptions, getTrustStoreOptions, isSsl, isTcpKeepAlive, isTcpNoDelay, isUseAlpn, isUsePooledBuffers
getLogActivity, getReceiveBufferSize, getSendBufferSize, getTrafficClass, isReuseAddress
public RedisOptions()
public RedisOptions(RedisOptions other)
public RedisOptions(JsonObject json)
public String getEncoding()
public RedisOptions setEncoding(String encoding)
public boolean isBinary()
public RedisOptions setBinary(boolean binary)
public String getAddress()
public RedisOptions setAddress(String address)
public String getHost()
public RedisOptions setHost(String host)
public int getPort()
public RedisOptions setPort(int port)
port
- tcp port.public String getAuth()
public RedisOptions setAuth(String auth)
auth
- passwordpublic Integer getSelect()
public RedisOptions setSelect(Integer select)
public String getMasterName()
public RedisOptions setMasterName(String masterName)
masterName
- name of Redis masterpublic RedisOptions addSentinel(String sentinelHostAndPort)
sentinelHostAndPort
- Sentinel node on the form 'hostname:port'public List<String> getSentinels()
public RedisOptions setSentinels(List<String> sentinels)
sentinels
- a list of sentinels host and port stringCopyright © 2017. All rights reserved.