@@ -46,10 +46,12 @@ public class RedisClusterConfiguration implements RedisConfiguration, ClusterCon
4646
4747	private  static  final  String  REDIS_CLUSTER_NODES_CONFIG_PROPERTY  = "spring.redis.cluster.nodes" ;
4848	private  static  final  String  REDIS_CLUSTER_MAX_REDIRECTS_CONFIG_PROPERTY  = "spring.redis.cluster.max-redirects" ;
49+ 	private  static  final  String  REDIS_CLUSTER_MAX_TOTAL_RETRIES_TIME  = "spring.redis.cluster.max-total-retries-time" ;
4950
5051	private  Set <RedisNode > clusterNodes ;
5152	private  @ Nullable  Integer  maxRedirects ;
5253	private  @ Nullable  String  username  = null ;
54+ 	private  @ Nullable  Integer  maxTotalRetriesTime ;
5355	private  RedisPassword  password  = RedisPassword .none ();
5456
5557	/** 
@@ -101,6 +103,10 @@ public RedisClusterConfiguration(PropertySource<?> propertySource) {
101103			this .maxRedirects  = NumberUtils .parseNumber (
102104					propertySource .getProperty (REDIS_CLUSTER_MAX_REDIRECTS_CONFIG_PROPERTY ).toString (), Integer .class );
103105		}
106+ 		if  (propertySource .containsProperty (REDIS_CLUSTER_MAX_TOTAL_RETRIES_TIME )) {
107+ 			this .maxTotalRetriesTime  = NumberUtils .parseNumber (
108+ 					propertySource .getProperty (REDIS_CLUSTER_MAX_TOTAL_RETRIES_TIME ).toString (), Integer .class );
109+ 		}
104110	}
105111
106112	/** 
@@ -158,6 +164,18 @@ public void setMaxRedirects(int maxRedirects) {
158164		this .maxRedirects  = maxRedirects ;
159165	}
160166
167+ 	@ Override  public  Integer  getMaxTotalRetriesTime () {
168+ 		return  maxTotalRetriesTime ;
169+ 	}
170+ 
171+ 	/** 
172+ 	 * @param maxTotalRetriesTime the max total retries time in millisecond(s) 
173+ 	 *                            only applicable to Jedis cluster connection. 
174+ 	 */ 
175+ 	public  void  setMaxTotalRetriesTime (Integer  maxTotalRetriesTime ) {
176+ 		this .maxTotalRetriesTime  = maxTotalRetriesTime ;
177+ 	}
178+ 
161179	/** 
162180	 * @param host Redis cluster node host name or ip address. 
163181	 * @param port Redis cluster node port. 
0 commit comments