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

yuzhou 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 b974362b37 Revert "fix RequestCode overflowed issues:8868 (#8871)" 
(#8874)
b974362b37 is described below

commit b974362b37c581b6bd77bca3dcac35bad71798d5
Author: Zhanhui Li <lizhan...@apache.org>
AuthorDate: Wed Oct 30 14:20:00 2024 +0800

    Revert "fix RequestCode overflowed issues:8868 (#8871)" (#8874)
    
    This reverts commit 327abe5d6eb0b74f48867821447e2f0718509a42.
---
 .../rocketmq/remoting/protocol/RequestCode.java    | 14 ++++----
 .../protocol/RocketMQSerializableTest.java         | 37 ----------------------
 2 files changed, 7 insertions(+), 44 deletions(-)

diff --git 
a/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RequestCode.java 
b/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RequestCode.java
index 1e10c96f42..cfc5cc2278 100644
--- 
a/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RequestCode.java
+++ 
b/remoting/src/main/java/org/apache/rocketmq/remoting/protocol/RequestCode.java
@@ -88,13 +88,13 @@ public class RequestCode {
 
     public static final int GET_TIMER_METRICS = 61;
 
-    public static final short POP_MESSAGE = 3442;
-    public static final short ACK_MESSAGE = 3443;
-    public static final short BATCH_ACK_MESSAGE = 3543;
-    public static final short PEEK_MESSAGE = 3444;
-    public static final short CHANGE_MESSAGE_INVISIBLETIME = 3445;
-    public static final short NOTIFICATION = 3446;
-    public static final short POLLING_INFO = 3447;
+    public static final int POP_MESSAGE = 200050;
+    public static final int ACK_MESSAGE = 200051;
+    public static final int BATCH_ACK_MESSAGE = 200151;
+    public static final int PEEK_MESSAGE = 200052;
+    public static final int CHANGE_MESSAGE_INVISIBLETIME = 200053;
+    public static final int NOTIFICATION = 200054;
+    public static final int POLLING_INFO = 200055;
 
     public static final int PUT_KV_CONFIG = 100;
 
diff --git 
a/remoting/src/test/java/org/apache/rocketmq/remoting/protocol/RocketMQSerializableTest.java
 
b/remoting/src/test/java/org/apache/rocketmq/remoting/protocol/RocketMQSerializableTest.java
index c7533bd0b7..7cf32d70c3 100644
--- 
a/remoting/src/test/java/org/apache/rocketmq/remoting/protocol/RocketMQSerializableTest.java
+++ 
b/remoting/src/test/java/org/apache/rocketmq/remoting/protocol/RocketMQSerializableTest.java
@@ -214,41 +214,4 @@ public class RocketMQSerializableTest {
         assertThat(h2.getStr()).isEqualTo("s1");
         assertThat(h2.getNum()).isEqualTo(100);
     }
-
-    @Test
-    public void testRequestCodeEncode() throws Exception {
-        testRequestCodeEncode(RequestCode.POP_MESSAGE);
-        testRequestCodeEncode(RequestCode.ACK_MESSAGE);
-        testRequestCodeEncode(RequestCode.BATCH_ACK_MESSAGE);
-        testRequestCodeEncode(RequestCode.PEEK_MESSAGE);
-        testRequestCodeEncode(RequestCode.CHANGE_MESSAGE_INVISIBLETIME);
-        testRequestCodeEncode(RequestCode.NOTIFICATION);
-        testRequestCodeEncode(RequestCode.POLLING_INFO);
-    }
-
-    public void testRequestCodeEncode(int code) throws Exception {
-        ByteBuf buf = ByteBufAllocator.DEFAULT.buffer(16);
-        MyHeader1 header1 = new MyHeader1();
-        header1.setStr("s1");
-        header1.setNum(100);
-        RemotingCommand cmd = RemotingCommand.createRequestCommand(code, 
header1);
-        cmd.setRemark("remark");
-        cmd.setOpaque(1001);
-        cmd.setVersion(99);
-        cmd.setLanguage(LanguageCode.JAVA);
-        cmd.setFlag(3);
-        cmd.makeCustomHeaderToNet();
-        RocketMQSerializable.rocketMQProtocolEncode(cmd, buf);
-        RemotingCommand cmd2 = 
RocketMQSerializable.rocketMQProtocolDecode(buf, buf.readableBytes());
-        assertThat(cmd2.getRemark()).isEqualTo("remark");
-        assertThat(cmd2.getCode()).isEqualTo(code);
-        assertThat(cmd2.getOpaque()).isEqualTo(1001);
-        assertThat(cmd2.getVersion()).isEqualTo(99);
-        assertThat(cmd2.getLanguage()).isEqualTo(LanguageCode.JAVA);
-        assertThat(cmd2.getFlag()).isEqualTo(3);
-
-        MyHeader1 h2 = (MyHeader1) 
cmd2.decodeCommandCustomHeader(MyHeader1.class);
-        assertThat(h2.getStr()).isEqualTo("s1");
-        assertThat(h2.getNum()).isEqualTo(100);
-    }
 }

Reply via email to