|
|
|
@ -232,17 +232,13 @@ public class MasterSlaveEntry {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
System.out.println("reattachBlockingQueue " + connection);
|
|
|
|
|
try {
|
|
|
|
|
RFuture<RedisConnection> newConnectionFuture = connectionWriteOp(commandData.getCommand());
|
|
|
|
|
System.out.println("newConnectionFuture " + newConnectionFuture);
|
|
|
|
|
newConnectionFuture.onComplete((newConnection, e) -> {
|
|
|
|
|
if (e != null) {
|
|
|
|
|
log.error("Can't resubscribe blocking queue " + commandData, e);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
System.out.println("newConnectionFuture1 " + connection);
|
|
|
|
|
AtomicBoolean skip = new AtomicBoolean();
|
|
|
|
|
BiConsumer<Object, Throwable> listener = new BiConsumer<Object, Throwable>() {
|
|
|
|
|
@Override
|
|
|
|
@ -257,7 +253,6 @@ public class MasterSlaveEntry {
|
|
|
|
|
if (commandData.getPromise().isDone()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
System.out.println("newConnectionFuture2 " + connection);
|
|
|
|
|
ChannelFuture channelFuture = newConnection.send(commandData);
|
|
|
|
|
channelFuture.addListener(new ChannelFutureListener() {
|
|
|
|
|
@Override
|
|
|
|
@ -267,17 +262,10 @@ public class MasterSlaveEntry {
|
|
|
|
|
skip.set(true);
|
|
|
|
|
releaseWrite(newConnection);
|
|
|
|
|
log.error("Can't resubscribe blocking queue {}", commandData);
|
|
|
|
|
} else {
|
|
|
|
|
System.out.println("resubscribed " + connection);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
} catch (Exception e2) {
|
|
|
|
|
e2.printStackTrace();
|
|
|
|
|
// TODO: handle exception
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean hasSlave(RedisClient redisClient) {
|
|
|
|
|