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 2021/01/09 11:35:43 UTC

[GitHub] [rocketmq] horizonzy opened a new issue #2578: [Code Quality]

horizonzy opened a new issue #2578:
URL: https://github.com/apache/rocketmq/issues/2578


   **FEATURE REQUEST**
   
   1. Please describe the feature you are requesting.
   ```
       public void processResponseCommand(ChannelHandlerContext ctx, RemotingCommand cmd) {
           final int opaque = cmd.getOpaque();
           final ResponseFuture responseFuture = responseTable.get(opaque);
           if (responseFuture != null) {
               responseFuture.setResponseCommand(cmd);
   
               responseTable.remove(opaque);
   
               if (responseFuture.getInvokeCallback() != null) {
                   executeInvokeCallback(responseFuture);
               } else {
                   responseFuture.putResponse(cmd);
                   responseFuture.release();
               }
           } else {
               log.warn("receive response, but not matched any request, " + RemotingHelper.parseChannelRemoteAddr(ctx.channel()));
               log.warn(cmd.toString());
           }
       }
   ```
   `responseFuture.setResponseCommand(cmd);` is repeat operation with `responseFuture.putResponse(cmd);`.
   Just execute in `if (responseFuture.getInvokeCallback() != null)` code block.
   
   


----------------------------------------------------------------
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