Closed yu-hailong closed 2 years ago
@tangyang9464 @imp2002
Would you please help and give me some suggestion to avoid the problem, we find the problem on product - env. thanks a lot
if exception happened ,should we "do while " and try to get a new jedis and subscibe again ??
@Override
public void run() {
while (true) {
try (Jedis jedis = jedisPool.getResource()) {
jedis.subscribe(subscriber, channel);
} catch (Exception e) {
e.printStackTrace();
}finally {
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
This change works for my local setup
It may be that server setting up the timeout not zero, it means after one period connection is disposed or closed. I'm not sure if a connect which is in subscribe will be closed by server, it's a guess.
Solution is set timeout on server to 0.
And Resubscribe is necessary, when an exception is thrown just like this or when redis is restart. Thank you for Issue and PR.
I used redis-watcher for distribute sync. If I did not push message on provider about five minutes, and the following error happened,
and , after the exception happened, even I did push message on provider, the following is not executed
maybe it is relation with the redis-server settings