修改:断线重连次数判断 bug

This commit is contained in:
梁显优 2023-03-06 21:51:51 +08:00
parent 1171304a04
commit 44c1cf9f0d

View File

@ -373,8 +373,13 @@ public class ZHubClient extends AbstractConsumer implements IConsumer, IProducer
}
return true;
} catch (Exception e) {
if (retry == 0 || i > 0) {
if (retry == 0 || i == 0) {
logger.log(Level.WARNING, String.format("ZHubClient[%s] %s Failed 初始化失败!", getGroupid(), retry == 0 ? "init" : "reconnection"), e);
try {
Thread.sleep(1000);
} catch (InterruptedException interruptedException) {
interruptedException.printStackTrace();
}
} else {
logger.log(Level.WARNING, String.format("ZHubClient[%s][%s] reconnection Failed", getGroupid(), i + 1));
try {