Skip to content

Commit 501c3a1

Browse files
committed
fix error when update topic
1 parent 2f89371 commit 501c3a1

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

common/src/main/java/org/apache/rocketmq/common/TopicConfig.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.util.HashMap;
2323
import java.util.Map;
2424
import java.util.Objects;
25+
import org.apache.rocketmq.common.attribute.AttributeParser;
2526
import org.apache.rocketmq.common.attribute.TopicMessageType;
2627
import 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

0 commit comments

Comments
 (0)