try { final ResponseFuture responseFuture = new ResponseFuture(request.getOpaque(), timeoutMillis, null, null); this.responseTable.put(request.getOpaque(), responseFuture); channel.writeAndFlush(request).addListener(new ChannelHandlerListener() { @Override this.responseTable.remove(request.getOpaque());
try { final ResponseFuture responseFuture = new ResponseFuture(request.getOpaque(), timeoutMillis, null, null); this.responseTable.put(request.getOpaque(), responseFuture); channel.writeAndFlush(request).addListener(new ChannelHandlerListener() { @Override this.responseTable.remove(request.getOpaque());
@Override public void operationComplete(Future future) throws Exception { if (future.isSuccess()) { responseFuture.setSendRequestOK(true); return; } else { responseFuture.setSendRequestOK(false); } responseTable.remove(request.getOpaque()); responseFuture.setCause(future.cause()); responseFuture.putResponse(null); LOGGER.warn("send a request command to channel <" + channel.remoteAddress() + "> failed."); LOGGER.warn(request.toString()); } });
@Override public void operationComplete(Future future) throws Exception { if (future.isSuccess()) { responseFuture.setSendRequestOK(true); return; } else { responseFuture.setSendRequestOK(false); } responseTable.remove(request.getOpaque()); responseFuture.setCause(future.cause()); responseFuture.putResponse(null); LOGGER.warn("send a request command to channel <" + channel.remoteAddress() + "> failed."); LOGGER.warn(request.toString()); } });
@Override public void operationComplete(Future future) throws Exception { if (future.isSuccess()) { responseFuture.setSendRequestOK(true); return; } else { responseFuture.setSendRequestOK(false); } responseFuture.putResponse(null); try { responseFuture.executeInvokeCallback(); } finally { responseFuture.release(); } responseTable.remove(request.getOpaque()); LOGGER.warn("send a request command to channel <" + channel.remoteAddress() + "> failed."); LOGGER.warn(request.toString()); } });
@Override public void operationComplete(Future future) throws Exception { if (future.isSuccess()) { responseFuture.setSendRequestOK(true); return; } else { responseFuture.setSendRequestOK(false); } responseFuture.putResponse(null); try { responseFuture.executeInvokeCallback(); } finally { responseFuture.release(); } responseTable.remove(request.getOpaque()); LOGGER.warn("send a request command to channel <" + channel.remoteAddress() + "> failed."); LOGGER.warn(request.toString()); } });
RemotingCommand.createResponseCommand(RemotingProtos.ResponseCode.SYSTEM_BUSY.code(), "too many requests and system thread pool busy, please try another server"); response.setOpaque(cmd.getOpaque()); channel.writeAndFlush(response); RemotingCommand.createResponseCommand(RemotingProtos.ResponseCode.REQUEST_CODE_NOT_SUPPORTED.code(), error); response.setOpaque(cmd.getOpaque()); channel.writeAndFlush(response); LOGGER.error(RemotingHelper.parseChannelRemoteAddr(channel) + error);
RemotingCommand.createResponseCommand(RemotingProtos.ResponseCode.SYSTEM_BUSY.code(), "too many requests and system thread pool busy, please try another server"); response.setOpaque(cmd.getOpaque()); channel.writeAndFlush(response); RemotingCommand.createResponseCommand(RemotingProtos.ResponseCode.REQUEST_CODE_NOT_SUPPORTED.code(), error); response.setOpaque(cmd.getOpaque()); channel.writeAndFlush(response); LOGGER.error(RemotingHelper.parseChannelRemoteAddr(channel) + error);
try { final ResponseFuture responseFuture = new ResponseFuture(request.getOpaque(), timeoutMillis, null, null); this.responseTable.put(request.getOpaque(), responseFuture); channel.writeAndFlush(request).addListener(new ChannelHandlerListener() { @Override this.responseTable.remove(request.getOpaque());
@Override public void operationComplete(Future future) throws Exception { if (future.isSuccess()) { responseFuture.setSendRequestOK(true); return; } else { responseFuture.setSendRequestOK(false); } responseFuture.putResponse(null); responseFuture.executeInvokeCallback(); responseTable.remove(request.getOpaque()); LOGGER.warn("send a request command to channel <" + channel.remoteAddress() + "> failed."); LOGGER.warn(request.toString()); } });
@Override public void operationComplete(Future future) throws Exception { if (future.isSuccess()) { responseFuture.setSendRequestOK(true); return; } else { responseFuture.setSendRequestOK(false); } responseTable.remove(request.getOpaque()); responseFuture.setCause(future.cause()); responseFuture.putResponse(null); LOGGER.warn("send a request command to channel <" + channel.remoteAddress() + "> failed."); LOGGER.warn(request.toString()); } });