This is an automated email from the ASF dual-hosted git repository.

jinrongtong pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git


The following commit(s) were added to refs/heads/develop by this push:
     new f2d4e0d7b3 [ISSUE #9203] Replace numbers with static variables defined 
in RequestCode
f2d4e0d7b3 is described below

commit f2d4e0d7b33bec661f3b55e40fb774f042dc98ea
Author: 阿洋 <xinzhuxiansh...@126.com>
AuthorDate: Tue Feb 25 08:09:53 2025 +0800

    [ISSUE #9203] Replace numbers with static variables defined in RequestCode
---
 .../java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java   | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java
 
b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java
index e92809ccdf..92ced6b01a 100644
--- 
a/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java
+++ 
b/remoting/src/main/java/org/apache/rocketmq/remoting/netty/NettyRemotingClient.java
@@ -87,6 +87,7 @@ import 
org.apache.rocketmq.remoting.exception.RemotingSendRequestException;
 import org.apache.rocketmq.remoting.exception.RemotingTimeoutException;
 import org.apache.rocketmq.remoting.exception.RemotingTooMuchRequestException;
 import org.apache.rocketmq.remoting.protocol.RemotingCommand;
+import org.apache.rocketmq.remoting.protocol.RequestCode;
 import org.apache.rocketmq.remoting.protocol.ResponseCode;
 import org.apache.rocketmq.remoting.proxy.SocksProxyConfig;
 
@@ -604,7 +605,7 @@ public class NettyRemotingClient extends 
NettyRemotingAbstract implements Remoti
             }
             String remoteAddr = 
RemotingHelper.parseChannelRemoteAddr(responseFuture.getChannel());
             // interrupt only pull message request
-            if (brokerAddrSet.contains(remoteAddr) && (cmd.getCode() == 11 || 
cmd.getCode() == 361)) {
+            if (brokerAddrSet.contains(remoteAddr) && (cmd.getCode() == 
RequestCode.PULL_MESSAGE || cmd.getCode() == RequestCode.LITE_PULL_MESSAGE)) {
                 LOGGER.info("interrupt {}", cmd);
                 responseFuture.interrupt();
             }

Reply via email to