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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]