public class SingleServerConfig extends Object
Modifier and Type | Method and Description |
---|---|
String |
getAddress() |
String |
getClientName() |
int |
getConnectionMinimumIdleSize() |
int |
getConnectionPoolSize() |
int |
getConnectTimeout() |
int |
getDatabase() |
long |
getDnsMonitoringInterval() |
int |
getIdleConnectionTimeout() |
String |
getPassword() |
int |
getPingConnectionInterval() |
int |
getPingTimeout() |
int |
getRetryAttempts() |
int |
getRetryInterval() |
URL |
getSslKeystore() |
String |
getSslKeystorePassword() |
SslProvider |
getSslProvider() |
URL |
getSslTruststore() |
String |
getSslTruststorePassword() |
int |
getSubscriptionConnectionMinimumIdleSize() |
int |
getSubscriptionConnectionPoolSize() |
int |
getSubscriptionsPerConnection() |
int |
getTimeout() |
boolean |
isKeepAlive() |
boolean |
isSslEnableEndpointIdentification() |
boolean |
isTcpNoDelay() |
SingleServerConfig |
setAddress(String address)
Set server address.
|
T |
setClientName(String clientName)
Setup connection name during connection init
via CLIENT SETNAME command
|
SingleServerConfig |
setConnectionMinimumIdleSize(int connectionMinimumIdleSize)
Minimum idle Redis connection amount.
|
SingleServerConfig |
setConnectionPoolSize(int connectionPoolSize)
Redis connection pool size
Default is
64 |
T |
setConnectTimeout(int connectTimeout)
Timeout during connecting to any Redis server.
|
SingleServerConfig |
setDatabase(int database)
Database index used for Redis connection
Default is
0 |
SingleServerConfig |
setDnsMonitoringInterval(long dnsMonitoringInterval)
Interval in milliseconds to check the endpoint's DNS
Applications must ensure the JVM DNS cache TTL is low enough to support this.
|
T |
setFailedAttempts(int slaveFailedAttempts)
Deprecated.
|
T |
setIdleConnectionTimeout(int idleConnectionTimeout)
If pooled connection not used for a
timeout time
and current connections amount bigger than minimum idle connections pool size,
then it will closed and removed from pool. |
T |
setKeepAlive(boolean keepAlive)
Enables TCP keepAlive for connection
Default is
false |
T |
setPassword(String password)
Password for Redis authentication.
|
T |
setPingConnectionInterval(int pingConnectionInterval)
Defines PING command sending interval per connection to Redis.
|
T |
setPingTimeout(int pingTimeout)
Deprecated.
|
T |
setReconnectionTimeout(int slaveRetryTimeout)
Deprecated.
|
T |
setRetryAttempts(int retryAttempts)
Error will be thrown if Redis command can't be sent to Redis server after
retryAttempts . |
T |
setRetryInterval(int retryInterval)
Defines time interval for another one attempt send Redis command
if it hasn't been sent already.
|
T |
setSslEnableEndpointIdentification(boolean sslEnableEndpointIdentification)
Enables SSL endpoint identification.
|
T |
setSslKeystore(URL sslKeystore)
Defines path to SSL keystore
|
T |
setSslKeystorePassword(String sslKeystorePassword)
Defines password for SSL keystore
|
T |
setSslProvider(SslProvider sslProvider)
Defines SSL provider used to handle SSL connections.
|
T |
setSslTruststore(URL sslTruststore)
Defines path to SSL truststore
|
T |
setSslTruststorePassword(String sslTruststorePassword)
Defines password for SSL truststore
|
SingleServerConfig |
setSubscriptionConnectionMinimumIdleSize(int subscriptionConnectionMinimumIdleSize)
Minimum idle subscription connection amount.
|
SingleServerConfig |
setSubscriptionConnectionPoolSize(int subscriptionConnectionPoolSize)
Redis subscription-connection pool size limit
Default is
50 |
T |
setSubscriptionsPerConnection(int subscriptionsPerConnection)
Subscriptions per Redis connection limit
Default is 5
|
T |
setTcpNoDelay(boolean tcpNoDelay)
Enables TCP noDelay for connection
Default is
false |
T |
setTimeout(int timeout)
Redis server response timeout.
|
public SingleServerConfig setConnectionPoolSize(int connectionPoolSize)
Default is 64
connectionPoolSize
- - pool sizepublic int getConnectionPoolSize()
public SingleServerConfig setSubscriptionConnectionPoolSize(int subscriptionConnectionPoolSize)
Default is 50
subscriptionConnectionPoolSize
- - pool sizepublic int getSubscriptionConnectionPoolSize()
public SingleServerConfig setAddress(String address)
address
- of Redispublic String getAddress()
public SingleServerConfig setDnsMonitoringInterval(long dnsMonitoringInterval)
Applications must ensure the JVM DNS cache TTL is low enough to support this.
Set -1
to disable.
Default is 5000
.
dnsMonitoringInterval
- timepublic long getDnsMonitoringInterval()
public SingleServerConfig setSubscriptionConnectionMinimumIdleSize(int subscriptionConnectionMinimumIdleSize)
Default is 1
subscriptionConnectionMinimumIdleSize
- - connections amountpublic int getSubscriptionConnectionMinimumIdleSize()
public SingleServerConfig setConnectionMinimumIdleSize(int connectionMinimumIdleSize)
Default is 24
connectionMinimumIdleSize
- - connections amountpublic int getConnectionMinimumIdleSize()
public SingleServerConfig setDatabase(int database)
0
database
- indexpublic int getDatabase()
public T setSubscriptionsPerConnection(int subscriptionsPerConnection)
subscriptionsPerConnection
- amountpublic int getSubscriptionsPerConnection()
public T setPassword(String password)
null
password
- for connectionpublic String getPassword()
public T setRetryAttempts(int retryAttempts)
retryAttempts
.
But if it sent successfully then timeout
will be started.
Default is 3
attempts
retryAttempts
- - retry attemptstimeout
public int getRetryAttempts()
public T setRetryInterval(int retryInterval)
Default is 1500
milliseconds
retryInterval
- - time in millisecondspublic int getRetryInterval()
public T setTimeout(int timeout)
Default is 3000
milliseconds
timeout
- in millisecondspublic int getTimeout()
public T setClientName(String clientName)
clientName
- - name of clientpublic String getClientName()
@Deprecated public T setPingTimeout(int pingTimeout)
public int getPingTimeout()
public T setConnectTimeout(int connectTimeout)
Default is 10000
milliseconds.
connectTimeout
- - timeout in millisecondspublic int getConnectTimeout()
public T setIdleConnectionTimeout(int idleConnectionTimeout)
timeout
time
and current connections amount bigger than minimum idle connections pool size,
then it will closed and removed from pool.
Default is 10000
milliseconds.
idleConnectionTimeout
- - timeout in millisecondspublic int getIdleConnectionTimeout()
@Deprecated public T setReconnectionTimeout(int slaveRetryTimeout)
@Deprecated public T setFailedAttempts(int slaveFailedAttempts)
public boolean isSslEnableEndpointIdentification()
public T setSslEnableEndpointIdentification(boolean sslEnableEndpointIdentification)
Default is true
sslEnableEndpointIdentification
- - boolean valuepublic SslProvider getSslProvider()
public T setSslProvider(SslProvider sslProvider)
Default is JDK
sslProvider
- - ssl providerpublic URL getSslTruststore()
public T setSslTruststore(URL sslTruststore)
sslTruststore
- - pathpublic String getSslTruststorePassword()
public T setSslTruststorePassword(String sslTruststorePassword)
sslTruststorePassword
- - passwordpublic URL getSslKeystore()
public T setSslKeystore(URL sslKeystore)
sslKeystore
- - path to keystorepublic String getSslKeystorePassword()
public T setSslKeystorePassword(String sslKeystorePassword)
sslKeystorePassword
- - passwordpublic int getPingConnectionInterval()
public T setPingConnectionInterval(int pingConnectionInterval)
0
means disable.
Default is 0
pingConnectionInterval
- - time in millisecondspublic boolean isKeepAlive()
public T setKeepAlive(boolean keepAlive)
Default is false
keepAlive
- - boolean valuepublic boolean isTcpNoDelay()
public T setTcpNoDelay(boolean tcpNoDelay)
Default is false
tcpNoDelay
- - boolean valueCopyright © 2014–2020 Redisson. All rights reserved.