@Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { log.error("FilterServer response to " + future.channel().remoteAddress() + " failed", future.cause()); log.error(response.toString()); } } });
protected void doResponse(ChannelHandlerContext ctx, RemotingCommand request, final RemotingCommand response) { if (!request.isOnewayRPC()) { try { ctx.writeAndFlush(response); } catch (Throwable e) { log.error("SendMessageProcessor process request over, but response failed", e); log.error(request.toString()); log.error(response.toString()); } } }
protected void doResponse(ChannelHandlerContext ctx, RemotingCommand request, final RemotingCommand response) { if (!request.isOnewayRPC()) { try { ctx.writeAndFlush(response); } catch (Throwable e) { log.error("SendMessageProcessor process request over, but response failed", e); log.error(request.toString()); log.error(response.toString()); } } }
@Override public void run() { try { final RemotingCommand response = PullMessageProcessor.this.processRequest(channel, request, false); if (response != null) { response.setOpaque(request.getOpaque()); response.markResponseType(); try { channel.writeAndFlush(response).addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { if (!future.isSuccess()) { log.error("processRequestWrapper response to " + future.channel().remoteAddress() + " failed", future.cause()); log.error(request.toString()); log.error(response.toString()); } } }); } catch (Throwable e) { log.error("processRequestWrapper process request over, but response failed", e); log.error(request.toString()); log.error(response.toString()); } } } catch (RemotingCommandException e1) { log.error("excuteRequestWhenWakeup run", e1); } } };
@Override public void encode(ChannelHandlerContext ctx, RemotingCommand remotingCommand, ByteBuf out) throws Exception { try { ByteBuffer header = remotingCommand.encodeHeader(); out.writeBytes(header); byte[] body = remotingCommand.getBody(); if (body != null) { out.writeBytes(body); } } catch (Exception e) { log.error("encode exception, " + RemotingHelper.parseChannelRemoteAddr(ctx.channel()), e); if (remotingCommand != null) { log.error(remotingCommand.toString()); } RemotingUtil.closeChannel(ctx.channel()); } } }
@Override public void encode(ChannelHandlerContext ctx, RemotingCommand remotingCommand, ByteBuf out) throws Exception { try { ByteBuffer header = remotingCommand.encodeHeader(); out.writeBytes(header); byte[] body = remotingCommand.getBody(); if (body != null) { out.writeBytes(body); } } catch (Exception e) { log.error("encode exception, " + RemotingHelper.parseChannelRemoteAddr(ctx.channel()), e); if (remotingCommand != null) { log.error(remotingCommand.toString()); } RemotingUtil.closeChannel(ctx.channel()); } } }
} catch (Throwable e) { log.error("FilterServer process request over, but response failed", e); log.error(response.toString());
plog.warn(cmd.toString());
plog.warn(cmd.toString());
plog.warn(cmd.toString());
@Override public void encode(ChannelHandlerContext ctx, RemotingCommand remotingCommand, ByteBuf out) throws Exception { try { ByteBuffer header = remotingCommand.encodeHeader(); out.writeBytes(header); byte[] body = remotingCommand.getBody(); if (body != null) { out.writeBytes(body); } } catch (Exception e) { log.error("encode exception, " + RemotingHelper.parseChannelRemoteAddr(ctx.channel()), e); if (remotingCommand != null) { log.error(remotingCommand.toString()); } RemotingUtil.closeChannel(ctx.channel()); } } }