Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

delete sysytem proerty #689

Merged
merged 2 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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);
}
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,14 @@ public static org.apache.rocketmq.client.apis.message.Message getAndWrapMessage(
}
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();
}
Expand Down
Loading