Skip to content

Commit

Permalink
Remove clientid and groupid from jmstrace
Browse files Browse the repository at this point in the history
  • Loading branch information
ozangunalp committed Aug 29, 2024
1 parent 8794852 commit caae6f8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<String, Object> messageProperties;

private JmsTrace(final String groupId, final String clientId, final String queue, Map<String, Object> messageProperties) {
this.groupId = groupId;
this.clientId = clientId;
private JmsTrace(final String queue, Map<String, Object> messageProperties) {
this.queue = queue;
this.messageProperties = messageProperties;
}

public String getGroupId() {
return groupId;
}

public String getClientId() {
return clientId;
}

public String getQueue() {
return queue;
}
Expand All @@ -33,21 +21,9 @@ public Map<String, Object> getMessageProperties() {
}

public static class Builder {
private String groupId;
private String clientId;
private String queue;
private Map<String, Object> 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;
Expand All @@ -59,7 +35,7 @@ public Builder withProperties(Map<String, Object> properties) {
}

public JmsTrace build() {
return new JmsTrace(groupId, clientId, queue, properties);
return new JmsTrace(queue, properties);
}
}
}

0 comments on commit caae6f8

Please sign in to comment.