Bug fixes and added redis sentinel supportability changes.
parent
de63bca985
commit
4abfa4b37a
|
@ -10,7 +10,7 @@ public interface DataCacheConstants {
|
|||
String REDIS_HOSTS = "redis.hosts";
|
||||
String REDIS_CLUSTER_ENABLED = "redis.cluster.enabled:false";
|
||||
String REDIS_SENTINEL_ENABLED = "redis.sentinel.enabled:false";
|
||||
String REDIS_LB_STICKY_SESSION_ENABLED = "redis.load-balancer.sticky-session.enabled:false";
|
||||
String LB_STICKY_SESSION_ENABLED = "lb.sticky-session.enabled:false";
|
||||
|
||||
String REDIS_MAX_ACTIVE = "redis.max.active:10";
|
||||
String REDIS_TEST_ONBORROW = "redis.test.onBorrow:true";
|
||||
|
|
|
@ -27,7 +27,7 @@ public class DataCacheFactory {
|
|||
public DataCache getDataCache() {
|
||||
Properties properties = getApplicationProperties();
|
||||
|
||||
if (Boolean.valueOf(getProperty(properties, DataCacheConstants.REDIS_LB_STICKY_SESSION_ENABLED))) {
|
||||
if (Boolean.valueOf(getProperty(properties, DataCacheConstants.LB_STICKY_SESSION_ENABLED))) {
|
||||
return new StandardDataCache(properties, this.sessionExpiryTime);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,4 +18,11 @@ redis.sentinel.master=mymaster
|
|||
#redis.database=0
|
||||
|
||||
#- redis connection timeout (default value: 2000)
|
||||
#redis.timeout=2000
|
||||
#redis.timeout=2000
|
||||
|
||||
#- enable redis and standard session mode.
|
||||
# If enabled,
|
||||
# 1. Must be enabled sticky session in your load balancer configuration. Else this manager may not return the updated session values.
|
||||
# 2. Session values are stored in local jvm and redis.
|
||||
# 3. If redis is down/not responding, requests uses jvm stored session values to process user requests. Redis comes back the values will be synced.
|
||||
lb.sticky-session.enabled=false
|
||||
|
|
Loading…
Reference in New Issue