Fixed - Unable to connect to Redis server error is thrown due to NPE #4231

pull/4239/head
Nikita Koksharov 3 years ago
parent b8d44abd76
commit 723928443e

@ -24,7 +24,6 @@ import org.redisson.client.protocol.QueueCommand;
import org.redisson.client.protocol.QueueCommandHolder;
import org.redisson.misc.LogHelper;
import java.net.SocketAddress;
import java.util.Deque;
import java.util.Iterator;
import java.util.Queue;
@ -42,9 +41,8 @@ public class CommandsQueue extends ChannelDuplexHandler {
public static final AttributeKey<Deque<QueueCommandHolder>> COMMANDS_QUEUE = AttributeKey.valueOf("COMMANDS_QUEUE");
@Override
public void connect(ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) throws Exception {
super.connect(ctx, remoteAddress, localAddress, promise);
public void channelRegistered(ChannelHandlerContext ctx) throws Exception {
super.channelRegistered(ctx);
ctx.channel().attr(COMMANDS_QUEUE).set(new ConcurrentLinkedDeque<>());
}

Loading…
Cancel
Save