diff --git a/agent-plugins/agent-rocketmq-4.x-plugin/src/main/java/cloud/erda/agent/plugin/rocketmq/v4/MessageSendInterceptor.java b/agent-plugins/agent-rocketmq-4.x-plugin/src/main/java/cloud/erda/agent/plugin/rocketmq/v4/MessageSendInterceptor.java index 84976a1..b28a767 100644 --- a/agent-plugins/agent-rocketmq-4.x-plugin/src/main/java/cloud/erda/agent/plugin/rocketmq/v4/MessageSendInterceptor.java +++ b/agent-plugins/agent-rocketmq-4.x-plugin/src/main/java/cloud/erda/agent/plugin/rocketmq/v4/MessageSendInterceptor.java @@ -84,7 +84,12 @@ public void beforeMethod(IMethodInterceptContext context, MethodInterceptResult tracer.inject(span.getContext(), carrier); SendMessageRequestHeader requestHeader = (SendMessageRequestHeader) context.getArguments()[3]; - StringBuilder properties = new StringBuilder(requestHeader.getProperties()); + StringBuilder properties = new StringBuilder(); + String originalProperties = requestHeader.getProperties(); + if(originalProperties != null && !originalProperties.isEmpty()) { + properties.append(originalProperties); + properties.append(MessageDecoder.PROPERTY_SEPARATOR); + } for (Map.Entry entry : map.entrySet()) { if (entry.getValue() == null) { continue;