Commit 58410825 by huangfusuper

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

parent c143dfab
...@@ -88,6 +88,8 @@ public class NettyPluginServerHandler extends SimpleChannelInboundHandler<Plugin ...@@ -88,6 +88,8 @@ public class NettyPluginServerHandler extends SimpleChannelInboundHandler<Plugin
rpcResponsePacket.setStatus(true); rpcResponsePacket.setStatus(true);
rpcResponsePacket.setRunTime(endTime-startTime); rpcResponsePacket.setRunTime(endTime-startTime);
rpcResponsePacket.setExtension(msg.getExtension()); rpcResponsePacket.setExtension(msg.getExtension());
rpcResponsePacket.setType(ResponseTyEnum.RESPONSE.getType());
ctx.channel().writeAndFlush(rpcResponsePacket);
}catch (Throwable e){ }catch (Throwable e){
rpcResponsePacket.setCode(JobResultEnum.FAIL.getCode()); rpcResponsePacket.setCode(JobResultEnum.FAIL.getCode());
rpcResponsePacket.setMsg(PluginLogUtils.getMessage(e)); rpcResponsePacket.setMsg(PluginLogUtils.getMessage(e));
...@@ -97,10 +99,11 @@ public class NettyPluginServerHandler extends SimpleChannelInboundHandler<Plugin ...@@ -97,10 +99,11 @@ public class NettyPluginServerHandler extends SimpleChannelInboundHandler<Plugin
execute.setMsg(PluginLogUtils.getMessage(e)); execute.setMsg(PluginLogUtils.getMessage(e));
execute.setCode(JobResultEnum.FAIL.getCode()); execute.setCode(JobResultEnum.FAIL.getCode());
rpcResponsePacket.setResult(execute); rpcResponsePacket.setResult(execute);
rpcResponsePacket.setType(ResponseTyEnum.RESPONSE.getType());
ctx.channel().writeAndFlush(rpcResponsePacket);
throw new RuntimeException(e); 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