From caae6f8e12d0f05eb48cf8e8f69898b86d9614cc Mon Sep 17 00:00:00 2001 From: Ozan Gunalp Date: Thu, 29 Aug 2024 12:34:19 +0200 Subject: [PATCH] Remove clientid and groupid from jmstrace --- .../jms/tracing/JmsAttributesExtractor.java | 15 ++-------- .../messaging/jms/tracing/JmsTrace.java | 28 ++----------------- 2 files changed, 4 insertions(+), 39 deletions(-) diff --git a/smallrye-reactive-messaging-jms/src/main/java/io/smallrye/reactive/messaging/jms/tracing/JmsAttributesExtractor.java b/smallrye-reactive-messaging-jms/src/main/java/io/smallrye/reactive/messaging/jms/tracing/JmsAttributesExtractor.java index 951244239..4bcca50be 100644 --- a/smallrye-reactive-messaging-jms/src/main/java/io/smallrye/reactive/messaging/jms/tracing/JmsAttributesExtractor.java +++ b/smallrye-reactive-messaging-jms/src/main/java/io/smallrye/reactive/messaging/jms/tracing/JmsAttributesExtractor.java @@ -19,15 +19,7 @@ public JmsAttributesExtractor() { @Override public void onStart(final AttributesBuilder attributes, final Context parentContext, final JmsTrace jmsTrace) { - String groupId = jmsTrace.getGroupId(); - String clientId = jmsTrace.getClientId(); - if (groupId != null && clientId != null) { - String consumerId = groupId; - if (!clientId.isEmpty()) { - consumerId += " - " + clientId; - } - attributes.put(MESSAGING_CLIENT_ID, consumerId); - } + } @Override @@ -97,10 +89,7 @@ public Long getMessageEnvelopeSize(JmsTrace jmsTrace) { @Override public String getClientId(JmsTrace jmsTrace) { - if (jmsTrace.getClientId() == null) { - return null; - } - return jmsTrace.getClientId(); + return null; } @Override diff --git a/smallrye-reactive-messaging-jms/src/main/java/io/smallrye/reactive/messaging/jms/tracing/JmsTrace.java b/smallrye-reactive-messaging-jms/src/main/java/io/smallrye/reactive/messaging/jms/tracing/JmsTrace.java index 2428f3afe..45a973719 100644 --- a/smallrye-reactive-messaging-jms/src/main/java/io/smallrye/reactive/messaging/jms/tracing/JmsTrace.java +++ b/smallrye-reactive-messaging-jms/src/main/java/io/smallrye/reactive/messaging/jms/tracing/JmsTrace.java @@ -4,26 +4,14 @@ import java.util.Map; public class JmsTrace { - private final String groupId; - private final String clientId; private final String queue; private final Map messageProperties; - private JmsTrace(final String groupId, final String clientId, final String queue, Map messageProperties) { - this.groupId = groupId; - this.clientId = clientId; + private JmsTrace(final String queue, Map messageProperties) { this.queue = queue; this.messageProperties = messageProperties; } - public String getGroupId() { - return groupId; - } - - public String getClientId() { - return clientId; - } - public String getQueue() { return queue; } @@ -33,21 +21,9 @@ public Map getMessageProperties() { } public static class Builder { - private String groupId; - private String clientId; private String queue; private Map properties; - public Builder withGroupId(final String groupId) { - this.groupId = groupId; - return this; - } - - public Builder withClientId(final String clientId) { - this.clientId = clientId; - return this; - } - public Builder withQueue(final String queue) { this.queue = queue; return this; @@ -59,7 +35,7 @@ public Builder withProperties(Map properties) { } public JmsTrace build() { - return new JmsTrace(groupId, clientId, queue, properties); + return new JmsTrace(queue, properties); } } }