lizhanhui opened a new issue, #4434:
URL: https://github.com/apache/rocketmq/issues/4434

   Field `code` in RemotingCommand currently has two radically different 
semantics. 
   1, As operation code, indicating which operation to make on request;
   2, As status line code, indicate if the previous request is successful or 
not. If the request failed, it represents a kind of failure.
   
   It seems OK at the first sight except for violating [Single Responsibility 
Principle](https://en.wikipedia.org/wiki/Single-responsibility_principle). 
However, when an in-depth investigation is made, we found other drawbacks are 
brought about by this design flaw.
   
   Let's give an example. Let's assume we are to improve the observability of 
unmatched responses: 
https://github.com/apache/rocketmq/blob/aacaf91539a90b18de21a988a204b5e842497352/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingAbstract.java#L304
  It will simply impossible since the associated request has been unreachable, 
potentially due to time out.
   
   
    


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to