@Override public void channelActive(ChannelHandlerContext ctx) throws Exception { super.channelActive(ctx); if (proxyToTargetBrokerAddress == null) { if (log.isDebugEnabled()) { log.debug("{} Connected to broker", ctx.channel()); } } else { log.info("{} Connected through proxy to target broker at {}", ctx.channel(), proxyToTargetBrokerAddress); } // Send CONNECT command ctx.writeAndFlush(newConnectCommand()) .addListener(future -> { if (future.isSuccess()) { if (log.isDebugEnabled()) { log.debug("Complete: {}", future.isSuccess()); } state = State.SentConnectFrame; } else { log.warn("Error during handshake", future.cause()); ctx.close(); } }); }
@Override public void channelActive(ChannelHandlerContext ctx) throws Exception { super.channelActive(ctx); log.info("New connection from {}", remoteAddress); this.ctx = ctx; }
@Override public void channelActive(ChannelHandlerContext ctx) throws Exception { super.channelActive(ctx); newConnections.inc(); LOG.info("[{}] New connection opened", remoteAddress); }
@Override public void channelActive(ChannelHandlerContext ctx) throws Exception { super.channelActive(ctx); if (proxyToTargetBrokerAddress == null) { if (log.isDebugEnabled()) { log.debug("{} Connected to broker", ctx.channel()); } } else { log.info("{} Connected through proxy to target broker at {}", ctx.channel(), proxyToTargetBrokerAddress); } // Send CONNECT command ctx.writeAndFlush(newConnectCommand()) .addListener(future -> { if (future.isSuccess()) { if (log.isDebugEnabled()) { log.debug("Complete: {}", future.isSuccess()); } state = State.SentConnectFrame; } else { log.warn("Error during handshake", future.cause()); ctx.close(); } }); }