Package org.redisson.config
Class BaseConfig<T extends BaseConfig<T>>
java.lang.Object
org.redisson.config.BaseConfig<T>
- Type Parameters:
T
- config type
- Direct Known Subclasses:
BaseMasterSlaveServersConfig
,SingleServerConfig
- Author:
- Nikita Koksharov
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
int
int
int
int
String[]
String[]
int
int
int
int
int
int
int
boolean
boolean
boolean
setClientName
(String clientName) Setup connection name during connection init via CLIENT SETNAME commandsetCommandMapper
(CommandMapper commandMapper) Defines Command mapper which maps Redis command name.setConnectTimeout
(int connectTimeout) Timeout during connecting to any Redis server.setCredentialsResolver
(CredentialsResolver credentialsResolver) Defines Credentials resolver which is invoked during connection for Redis server authentication.setIdleConnectionTimeout
(int idleConnectionTimeout) If pooled connection not used for atimeout
time and current connections amount bigger than minimum idle connections pool size, then it will closed and removed from pool.setKeepAlive
(boolean keepAlive) Enables TCP keepAlive for connectionsetNameMapper
(NameMapper nameMapper) Defines Name mapper which maps Redisson object name.setPassword
(String password) Password for Redis authentication.setPingConnectionInterval
(int pingConnectionInterval) Defines PING command sending interval per connection to Redis.setRetryAttempts
(int retryAttempts) Error will be thrown if Redis command can't be sent to Redis server afterretryAttempts
.setRetryInterval
(int retryInterval) Defines time interval for another one attempt send Redis command if it hasn't been sent already.setSslCiphers
(String[] sslCiphers) Defines SSL ciphers.setSslEnableEndpointIdentification
(boolean sslEnableEndpointIdentification) Enables SSL endpoint identification.setSslKeyManagerFactory
(KeyManagerFactory keyManagerFactory) Defines SSL KeyManagerFactory.setSslKeystore
(URL sslKeystore) Defines path to SSL keystore.setSslKeystorePassword
(String sslKeystorePassword) Defines password for SSL keystoresetSslProtocols
(String[] sslProtocols) Defines SSL protocols.setSslProvider
(SslProvider sslProvider) Defines SSL provider used to handle SSL connections.setSslTrustManagerFactory
(TrustManagerFactory trustManagerFactory) Defines SSL TrustManagerFactory.setSslTruststore
(URL sslTruststore) Defines path to SSL truststoresetSslTruststorePassword
(String sslTruststorePassword) Defines password for SSL truststore.setSubscriptionsPerConnection
(int subscriptionsPerConnection) Subscriptions per Redis connection limitsetSubscriptionTimeout
(int subscriptionTimeout) Defines subscription timeout applied per channel subscription.setTcpKeepAliveCount
(int tcpKeepAliveCount) Defines the maximum number of keepalive probes TCP should send before dropping the connection.setTcpKeepAliveIdle
(int tcpKeepAliveIdle) Defines the time in seconds the connection needs to remain idle before TCP starts sending keepalive probes,setTcpKeepAliveInterval
(int tcpKeepAliveInterval) Defines the time in seconds between individual keepalive probes.setTcpNoDelay
(boolean tcpNoDelay) Enables TCP noDelay for connectionsetTcpUserTimeout
(int tcpUserTimeout) Defines the maximum amount of time in milliseconds that transmitted data may remain unacknowledged, or buffered data may remain untransmitted (due to zero window size) before TCP will forcibly close the connection.setTimeout
(int timeout) Redis server response timeout.setUsername
(String username) Username for Redis authentication.
-
Field Details
-
log
protected static final org.slf4j.Logger log
-
-
Method Details
-
setSubscriptionsPerConnection
Subscriptions per Redis connection limitDefault is
5
- Parameters:
subscriptionsPerConnection
- amount- Returns:
- config
-
getSubscriptionsPerConnection
public int getSubscriptionsPerConnection() -
setPassword
Password for Redis authentication. Should be null if not needed.Default is
null
- Parameters:
password
- for connection- Returns:
- config
-
getPassword
-
setUsername
Username for Redis authentication. Should be null if not neededDefault is
null
Requires Redis 6.0+
- Parameters:
username
- for connection- Returns:
- config
-
getUsername
-
setRetryAttempts
Error will be thrown if Redis command can't be sent to Redis server afterretryAttempts
. But if it sent successfully thentimeout
will be started.Default is
3
attempts- Parameters:
retryAttempts
- retry attempts- Returns:
- config
- See Also:
-
getRetryAttempts
public int getRetryAttempts() -
setRetryInterval
Defines time interval for another one attempt send Redis command if it hasn't been sent already.Default is
1500
milliseconds- Parameters:
retryInterval
- - time in milliseconds- Returns:
- config
-
getRetryInterval
public int getRetryInterval() -
setTimeout
Redis server response timeout. Starts to countdown when Redis command has been successfully sent.Default is
3000
milliseconds- Parameters:
timeout
- in milliseconds- Returns:
- config
-
getTimeout
public int getTimeout() -
getSubscriptionTimeout
public int getSubscriptionTimeout() -
setSubscriptionTimeout
Defines subscription timeout applied per channel subscription.Default is
7500
milliseconds.- Parameters:
subscriptionTimeout
- timeout in milliseconds- Returns:
- config
-
setClientName
Setup connection name during connection init via CLIENT SETNAME commandDefault is
null
- Parameters:
clientName
- name of client- Returns:
- config
-
getClientName
-
setConnectTimeout
Timeout during connecting to any Redis server.Default is
10000
milliseconds.- Parameters:
connectTimeout
- timeout in milliseconds- Returns:
- config
-
getConnectTimeout
public int getConnectTimeout() -
setIdleConnectionTimeout
If pooled connection not used for atimeout
time and current connections amount bigger than minimum idle connections pool size, then it will closed and removed from pool.Default is
10000
milliseconds.- Parameters:
idleConnectionTimeout
- timeout in milliseconds- Returns:
- config
-
getIdleConnectionTimeout
public int getIdleConnectionTimeout() -
isSslEnableEndpointIdentification
public boolean isSslEnableEndpointIdentification() -
setSslEnableEndpointIdentification
Enables SSL endpoint identification.Default is
true
- Parameters:
sslEnableEndpointIdentification
- boolean value- Returns:
- config
-
getSslProvider
-
setSslProvider
Defines SSL provider used to handle SSL connections.Default is
JDK
- Parameters:
sslProvider
- ssl provider- Returns:
- config
-
getSslTruststore
-
setSslTruststore
Defines path to SSL truststoreDefault is
null
- Parameters:
sslTruststore
- truststore path- Returns:
- config
-
getSslTruststorePassword
-
setSslTruststorePassword
Defines password for SSL truststore. SSL truststore is read on each new connection creation and can be dynamically reloaded.Default is
null
- Parameters:
sslTruststorePassword
- - password- Returns:
- config
-
getSslKeystore
-
setSslKeystore
Defines path to SSL keystore. SSL keystore is read on each new connection creation and can be dynamically reloaded.Default is
null
- Parameters:
sslKeystore
- path to keystore- Returns:
- config
-
getSslKeystorePassword
-
setSslKeystorePassword
Defines password for SSL keystoreDefault is
null
- Parameters:
sslKeystorePassword
- password- Returns:
- config
-
getSslProtocols
-
setSslProtocols
Defines SSL protocols. Example values: TLSv1.3, TLSv1.2, TLSv1.1, TLSv1Default is
null
- Parameters:
sslProtocols
- protocols- Returns:
- config
-
getPingConnectionInterval
public int getPingConnectionInterval() -
setPingConnectionInterval
Defines PING command sending interval per connection to Redis.0
means disable.Default is
30000
- Parameters:
pingConnectionInterval
- time in milliseconds- Returns:
- config
-
isKeepAlive
public boolean isKeepAlive() -
setKeepAlive
Enables TCP keepAlive for connectionDefault is
false
- Parameters:
keepAlive
- boolean value- Returns:
- config
-
getTcpKeepAliveCount
public int getTcpKeepAliveCount() -
setTcpKeepAliveCount
Defines the maximum number of keepalive probes TCP should send before dropping the connection.- Parameters:
tcpKeepAliveCount
- maximum number of keepalive probes- Returns:
- config
-
getTcpKeepAliveIdle
public int getTcpKeepAliveIdle() -
setTcpKeepAliveIdle
Defines the time in seconds the connection needs to remain idle before TCP starts sending keepalive probes,- Parameters:
tcpKeepAliveIdle
- time in seconds- Returns:
- config
-
getTcpKeepAliveInterval
public int getTcpKeepAliveInterval() -
setTcpKeepAliveInterval
Defines the time in seconds between individual keepalive probes.- Parameters:
tcpKeepAliveInterval
- time in seconds- Returns:
- config
-
getTcpUserTimeout
public int getTcpUserTimeout() -
setTcpUserTimeout
Defines the maximum amount of time in milliseconds that transmitted data may remain unacknowledged, or buffered data may remain untransmitted (due to zero window size) before TCP will forcibly close the connection.- Parameters:
tcpUserTimeout
- time in milliseconds- Returns:
- config
-
isTcpNoDelay
public boolean isTcpNoDelay() -
setTcpNoDelay
Enables TCP noDelay for connectionDefault is
true
- Parameters:
tcpNoDelay
- boolean value- Returns:
- config
-
getNameMapper
-
setNameMapper
Defines Name mapper which maps Redisson object name. Applied to all Redisson objects.- Parameters:
nameMapper
- name mapper object- Returns:
- config
-
getCredentialsResolver
-
setCredentialsResolver
Defines Credentials resolver which is invoked during connection for Redis server authentication. It makes possible to specify dynamically changing Redis credentials.- Parameters:
credentialsResolver
- Credentials resolver object- Returns:
- config
-
getSslCiphers
-
setSslCiphers
Defines SSL ciphers.Default is
null
- Parameters:
sslCiphers
- ciphers- Returns:
- config
-
getSslTrustManagerFactory
-
setSslTrustManagerFactory
Defines SSL TrustManagerFactory.Default is
null
- Parameters:
trustManagerFactory
- trust manager value- Returns:
- config
-
getSslKeyManagerFactory
-
setSslKeyManagerFactory
Defines SSL KeyManagerFactory.Default is
null
- Parameters:
keyManagerFactory
- key manager value- Returns:
- config
-
getCommandMapper
-
setCommandMapper
Defines Command mapper which maps Redis command name. Applied to all Redis commands.- Parameters:
commandMapper
- Redis command name mapper object- Returns:
- config
-