File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed
rocketmq-v5-client-spring-boot/src/main/java/org/apache/rocketmq/client/support Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change 1616 */
1717package org .apache .rocketmq .client .support ;
1818
19+ import java .util .HashSet ;
20+ import java .util .Set ;
21+
1922public class RocketMQHeaders {
2023 public static final String PREFIX = "rocketmq_" ;
2124 public static final String KEYS = "KEYS" ;
@@ -30,4 +33,22 @@ public class RocketMQHeaders {
3033 public static final String TRANSACTION_ID = "TRANSACTION_ID" ;
3134 public static final String DELAY = "DELAY" ;
3235 public static final String WAIT = "WAIT" ;
36+
37+ public static final Set <String > SYSTEM_PROPERTY_SET = new HashSet <String >() {
38+ {
39+ add (KEYS );
40+ add (TAGS );
41+ add (KEYS );
42+ add (TOPIC );
43+ add (MESSAGE_ID );
44+ add (BORN_TIMESTAMP );
45+ add (BORN_HOST );
46+ add (FLAG );
47+ add (QUEUE_ID );
48+ add (SYS_FLAG );
49+ add (TRANSACTION_ID );
50+ add (DELAY );
51+ add (WAIT );
52+ }
53+ };
3354}
Original file line number Diff line number Diff line change @@ -86,7 +86,14 @@ public static org.apache.rocketmq.client.apis.message.Message getAndWrapMessage(
8686 }
8787 messageBuilder .setBody (payloads );
8888 org .apache .rocketmq .client .apis .message .MessageBuilder builder = messageBuilder ;
89- headers .forEach ((key , value ) -> builder .addProperty (key , String .valueOf (value )));
89+ headers .forEach ((key , value ) ->
90+ {
91+ if (!RocketMQHeaders .SYSTEM_PROPERTY_SET .contains (key )) {
92+ builder .addProperty (key , String .valueOf (value ));
93+ }
94+ }
95+
96+ );
9097 }
9198 return messageBuilder .build ();
9299 }
You can’t perform that action at this time.
0 commit comments