Skip to content

Commit 180240b

Browse files
committed
Jedis version updated from 2.9.0 to 3.0.1 for solving redis cluster fixes
1 parent b895652 commit 180240b

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
1616
<java.version>1.7</java.version>
1717

18-
<jedis.version>2.9.0</jedis.version>
18+
<jedis.version>3.0.1</jedis.version>
1919
<commons-pool2.version>2.4.2</commons-pool2.version>
2020
<commons-logging.version>1.2</commons-logging.version>
2121

src/main/java/tomcat/request/session/data/cache/impl/redis/RedisClusterManager.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import redis.clients.jedis.JedisCluster;
55
import redis.clients.jedis.JedisPoolConfig;
66
import redis.clients.jedis.Protocol;
7-
import redis.clients.jedis.exceptions.JedisClusterMaxRedirectionsException;
87
import redis.clients.jedis.exceptions.JedisConnectionException;
8+
import redis.clients.jedis.exceptions.JedisRedirectionException;
99

1010
import java.util.Set;
1111

@@ -37,7 +37,7 @@ public byte[] set(String key, byte[] value) {
3737
try {
3838
retVal = this.cluster.set(key.getBytes(), value);
3939
retry = false;
40-
} catch (JedisClusterMaxRedirectionsException | JedisConnectionException ex) {
40+
} catch (JedisRedirectionException | JedisConnectionException ex) {
4141
handleException(tries, ex);
4242
}
4343
} while (retry && tries <= NUM_RETRIES);
@@ -55,7 +55,7 @@ public Long setnx(String key, byte[] value) {
5555
try {
5656
retVal = this.cluster.setnx(key.getBytes(), value);
5757
retry = false;
58-
} catch (JedisClusterMaxRedirectionsException | JedisConnectionException ex) {
58+
} catch (JedisRedirectionException | JedisConnectionException ex) {
5959
handleException(tries, ex);
6060
}
6161
} while (retry && tries <= NUM_RETRIES);
@@ -73,7 +73,7 @@ public Long expire(String key, int seconds) {
7373
try {
7474
retVal = this.cluster.expire(key, seconds);
7575
retry = false;
76-
} catch (JedisClusterMaxRedirectionsException | JedisConnectionException ex) {
76+
} catch (JedisRedirectionException | JedisConnectionException ex) {
7777
handleException(tries, ex);
7878
}
7979
} while (retry && tries <= NUM_RETRIES);
@@ -91,7 +91,7 @@ public byte[] get(String key) {
9191
try {
9292
retVal = this.cluster.get(key.getBytes());
9393
retry = false;
94-
} catch (JedisClusterMaxRedirectionsException | JedisConnectionException ex) {
94+
} catch (JedisRedirectionException | JedisConnectionException ex) {
9595
handleException(tries, ex);
9696
}
9797
} while (retry && tries <= NUM_RETRIES);
@@ -109,7 +109,7 @@ public Long delete(String key) {
109109
try {
110110
retVal = this.cluster.del(key);
111111
retry = false;
112-
} catch (JedisClusterMaxRedirectionsException | JedisConnectionException ex) {
112+
} catch (JedisRedirectionException | JedisConnectionException ex) {
113113
handleException(tries, ex);
114114
}
115115
} while (retry && tries <= NUM_RETRIES);

src/main/java/tomcat/request/session/data/cache/impl/redis/RedisManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import org.apache.commons.logging.LogFactory;
55
import redis.clients.jedis.Jedis;
66
import redis.clients.jedis.exceptions.JedisConnectionException;
7-
import redis.clients.util.Pool;
7+
import redis.clients.jedis.util.Pool;
88
import tomcat.request.session.data.cache.DataCache;
99
import tomcat.request.session.data.cache.DataCacheConstants;
1010

0 commit comments

Comments
 (0)