Commit 58410825 by huangfusuper

修复RPCserver调用失败后无法写回的BUG

parent c143dfab
......@@ -88,6 +88,8 @@ public class NettyPluginServerHandler extends SimpleChannelInboundHandler<Plugin
rpcResponsePacket.setStatus(true);
rpcResponsePacket.setRunTime(endTime-startTime);
rpcResponsePacket.setExtension(msg.getExtension());
rpcResponsePacket.setType(ResponseTyEnum.RESPONSE.getType());
ctx.channel().writeAndFlush(rpcResponsePacket);
}catch (Throwable e){
rpcResponsePacket.setCode(JobResultEnum.FAIL.getCode());
rpcResponsePacket.setMsg(PluginLogUtils.getMessage(e));
......@@ -97,10 +99,11 @@ public class NettyPluginServerHandler extends SimpleChannelInboundHandler<Plugin
execute.setMsg(PluginLogUtils.getMessage(e));
execute.setCode(JobResultEnum.FAIL.getCode());
rpcResponsePacket.setResult(execute);
rpcResponsePacket.setType(ResponseTyEnum.RESPONSE.getType());
ctx.channel().writeAndFlush(rpcResponsePacket);
throw new RuntimeException(e);
}
rpcResponsePacket.setType(ResponseTyEnum.RESPONSE.getType());
ctx.channel().writeAndFlush(rpcResponsePacket);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment