2222import java .util .HashMap ;
2323import java .util .Map ;
2424import java .util .Objects ;
25+ import org .apache .rocketmq .common .attribute .AttributeParser ;
2526import org .apache .rocketmq .common .attribute .TopicMessageType ;
2627import org .apache .rocketmq .common .constant .PermName ;
2728
@@ -203,7 +204,9 @@ public TopicMessageType getTopicMessageType() {
203204 if (attributes == null ) {
204205 return TopicMessageType .NORMAL ;
205206 }
206- String content = attributes .get (TOPIC_MESSAGE_TYPE_ATTRIBUTE .getName ());
207+ String content = attributes .get (TOPIC_MESSAGE_TYPE_ATTRIBUTE .getName ()) == null
208+ ? attributes .get (AttributeParser .ATTR_ADD_PLUS_SIGN + TOPIC_MESSAGE_TYPE_ATTRIBUTE .getName ())
209+ : attributes .get (TOPIC_MESSAGE_TYPE_ATTRIBUTE .getName ());
207210 if (content == null ) {
208211 return TopicMessageType .NORMAL ;
209212 }
@@ -212,7 +215,7 @@ public TopicMessageType getTopicMessageType() {
212215
213216 @ JSONField (serialize = false , deserialize = false )
214217 public void setTopicMessageType (TopicMessageType topicMessageType ) {
215- attributes .put (TOPIC_MESSAGE_TYPE_ATTRIBUTE .getName (), topicMessageType .getValue ());
218+ attributes .put (AttributeParser . ATTR_ADD_PLUS_SIGN + TOPIC_MESSAGE_TYPE_ATTRIBUTE .getName (), topicMessageType .getValue ());
216219 }
217220
218221 @ Override
@@ -265,9 +268,6 @@ public int hashCode() {
265268
266269 @ Override
267270 public String toString () {
268- return "TopicConfig [topicName=" + topicName + ", readQueueNums=" + readQueueNums
269- + ", writeQueueNums=" + writeQueueNums + ", perm=" + PermName .perm2String (perm )
270- + ", topicFilterType=" + topicFilterType + ", topicSysFlag=" + topicSysFlag + ", order=" + order
271- + ", attributes=" + attributes + "]" ;
271+ return "TopicConfig [topicName=" + topicName + ", readQueueNums=" + readQueueNums + ", writeQueueNums=" + writeQueueNums + ", perm=" + PermName .perm2String (perm ) + ", topicFilterType=" + topicFilterType + ", topicSysFlag=" + topicSysFlag + ", order=" + order + ", attributes=" + attributes + "]" ;
272272 }
273273}
0 commit comments