You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/12/03 07:38:40 UTC

[GitHub] [rocketmq] aaron-ai commented on a diff in pull request #5575: [ISSUE #5392] [RIP-55] Support remoting protocol in rocketmq proxy module

aaron-ai commented on code in PR #5575:
URL: https://github.com/apache/rocketmq/pull/5575#discussion_r1038744863


##########
common/src/main/java/org/apache/rocketmq/common/attribute/TopicMessageType.java:
##########
@@ -40,6 +42,22 @@ public String getValue() {
         return value;
     }
 
+    public static TopicMessageType parseFromMessageProperty(Map<String, String> messageProperty) {
+        String isTrans = messageProperty.get(MessageConst.PROPERTY_TRANSACTION_PREPARED);
+        String isTransValue = "true";
+        if (isTransValue.equals(isTrans)) {
+            return TopicMessageType.TRANSACTION;
+        } else if (messageProperty.get(MessageConst.PROPERTY_DELAY_TIME_LEVEL) != null
+            || messageProperty.get(MessageConst.PROPERTY_TIMER_DELIVER_MS) != null
+            || messageProperty.get(MessageConst.PROPERTY_TIMER_DELAY_SEC) != null) {
+            return TopicMessageType.DELAY;
+        } else if (messageProperty.get(MessageConst.PROPERTY_SHARDING_KEY) != null) {
+            return TopicMessageType.FIFO;
+        } else {
+            return TopicMessageType.NORMAL;
+        }
+    }

Review Comment:
   `else` here is redundant seemingly.



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

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