This is an automated email from the ASF dual-hosted git repository. jinrongtong pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/rocketmq-spring.git
The following commit(s) were added to refs/heads/master by this push: new 2728191 delete sysytem proerty (#689) 2728191 is described below commit 2728191b41c20f987a3aa548ebbcad2beb52512a Author: panzhi <panzh...@qq.com> AuthorDate: Mon Dec 16 14:27:54 2024 +0800 delete sysytem proerty (#689) * fix(): delete sysytem proerty * fix(): delete sysytem proerty --------- Co-authored-by: panzhi33 <wb-pz502...@alibaba-inc.com> --- .../rocketmq/client/support/RocketMQHeaders.java | 21 +++++++++++++++++++++ .../rocketmq/client/support/RocketMQUtil.java | 9 ++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/rocketmq-v5-client-spring-boot/src/main/java/org/apache/rocketmq/client/support/RocketMQHeaders.java b/rocketmq-v5-client-spring-boot/src/main/java/org/apache/rocketmq/client/support/RocketMQHeaders.java index 9d0145c..e4ab86f 100644 --- a/rocketmq-v5-client-spring-boot/src/main/java/org/apache/rocketmq/client/support/RocketMQHeaders.java +++ b/rocketmq-v5-client-spring-boot/src/main/java/org/apache/rocketmq/client/support/RocketMQHeaders.java @@ -16,6 +16,9 @@ */ package org.apache.rocketmq.client.support; +import java.util.HashSet; +import java.util.Set; + public class RocketMQHeaders { public static final String PREFIX = "rocketmq_"; public static final String KEYS = "KEYS"; @@ -30,4 +33,22 @@ public class RocketMQHeaders { public static final String TRANSACTION_ID = "TRANSACTION_ID"; public static final String DELAY = "DELAY"; public static final String WAIT = "WAIT"; + + public static final Set<String> SYSTEM_PROPERTY_SET = new HashSet<String>() { + { + add(KEYS); + add(TAGS); + add(KEYS); + add(TOPIC); + add(MESSAGE_ID); + add(BORN_TIMESTAMP); + add(BORN_HOST); + add(FLAG); + add(QUEUE_ID); + add(SYS_FLAG); + add(TRANSACTION_ID); + add(DELAY); + add(WAIT); + } + }; } diff --git a/rocketmq-v5-client-spring-boot/src/main/java/org/apache/rocketmq/client/support/RocketMQUtil.java b/rocketmq-v5-client-spring-boot/src/main/java/org/apache/rocketmq/client/support/RocketMQUtil.java index 4e95bf4..81f873d 100644 --- a/rocketmq-v5-client-spring-boot/src/main/java/org/apache/rocketmq/client/support/RocketMQUtil.java +++ b/rocketmq-v5-client-spring-boot/src/main/java/org/apache/rocketmq/client/support/RocketMQUtil.java @@ -86,7 +86,14 @@ public class RocketMQUtil { } messageBuilder.setBody(payloads); org.apache.rocketmq.client.apis.message.MessageBuilder builder = messageBuilder; - headers.forEach((key, value) -> builder.addProperty(key, String.valueOf(value))); + headers.forEach((key, value) -> + { + if (!RocketMQHeaders.SYSTEM_PROPERTY_SET.contains(key)) { + builder.addProperty(key, String.valueOf(value)); + } + } + + ); } return messageBuilder.build(); }