public class RedisOptions
extends io.vertx.core.net.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
Constructor and Description |
---|
RedisOptions() |
RedisOptions(io.vertx.core.json.JsonObject json) |
RedisOptions(RedisOptions other) |
Modifier and Type | Method and Description |
---|---|
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`.
|
int |
getPort()
Get the tcp port where the Redis server is listening, default 6379.
|
Integer |
getSelect()
Get the database to select at connection time.
|
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 |
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.
|
io.vertx.core.json.JsonObject |
toJSON() |
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
public RedisOptions()
public RedisOptions(RedisOptions other)
public RedisOptions(io.vertx.core.json.JsonObject json)
public String getEncoding()
public RedisOptions setEncoding(String encoding)
encoding
- the user character encodingpublic boolean isBinary()
public RedisOptions setBinary(boolean binary)
binary
- use binary messagespublic String getAddress()
public RedisOptions setAddress(String address)
address
- address prefix.public String getHost()
public RedisOptions setHost(String host)
host
- host namepublic 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)
select
- database idpublic io.vertx.core.json.JsonObject toJSON()
Copyright © 2017. All rights reserved.