You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2019/08/01 09:39:00 UTC

[GitHub] [rocketmq] baihezhuo opened a new issue #1357: 关于remoting模块NettyRemotingAbstract的一个问题

baihezhuo opened a new issue #1357: 关于remoting模块NettyRemotingAbstract的一个问题
URL: https://github.com/apache/rocketmq/issues/1357
 
 
   请教一下关于org.apache.rocketmq.remoting.netty.NettyRemotingAbstract#processRequestCommand方法的Oneway响应的一个问题,在pair对象为空时为什么会执行后创建RemotingCommand response对象写回呢?我理解Oneway就是单向通信,发送方没有返回值接收或者判断。是不是应该加上条件判断,如果是Oneway方式则不写回客户端。代码如下:
   ```
          if (pair != null) {
                         // ...
           } else {
           	
           	// issue: isOnewayRPC send error message ?
               String error = " request type " + cmd.getCode() + " not supported";
               final RemotingCommand response =
                   RemotingCommand.createResponseCommand(RemotingSysResponseCode.REQUEST_CODE_NOT_SUPPORTED, error);
               response.setOpaque(opaque);
               ctx.writeAndFlush(response);
               log.error(RemotingHelper.parseChannelRemoteAddr(ctx.channel()) + error);
           }
   ```
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services