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/12/30 07:12:01 UTC

[GitHub] [rocketmq] yuz10 commented on a change in pull request #3588: [ISSUE 3585] [Part B] Improve encode/decode performance

yuz10 commented on a change in pull request #3588:
URL: https://github.com/apache/rocketmq/pull/3588#discussion_r776595912



##########
File path: common/src/main/java/org/apache/rocketmq/common/protocol/header/SendMessageResponseHeader.java
##########
@@ -37,6 +42,37 @@
     public void checkFields() throws RemotingCommandException {
     }
 
+    @Override
+    public void encode(ByteBuf out) {
+        writeIfNotNull(out, "msgId", msgId);
+        writeIfNotNull(out, "queueId", queueId);
+        writeIfNotNull(out, "queueOffset", queueOffset);
+        writeIfNotNull(out, "transactionId", transactionId);
+    }
+
+    @Override
+    public void decode(HashMap<String, String> fields) throws RemotingCommandException {
+        String str = getAndCheckNotNull(fields, "msgId");

Review comment:
       It would be better to add a test to compare the old decode result and fast decode result in case we add a new field later.




-- 
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: dev-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org