Skip to content

Commit

Permalink
Remove deprecated messaging.url attribute from messaging getter (#8008)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Rzeszutek authored Mar 9, 2023
1 parent 4b0ff80 commit 998e781
Show file tree
Hide file tree
Showing 18 changed files with 11 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public static <REQUEST, RESPONSE> MessagingAttributesExtractorBuilder<REQUEST, R
this.capturedHeaders = lowercase(capturedHeaders);
}

@SuppressWarnings("deprecation") // operationName
@Override
public void onStart(AttributesBuilder attributes, Context parentContext, REQUEST request) {
internalSet(attributes, SemanticAttributes.MESSAGING_SYSTEM, getter.getSystem(request));
Expand All @@ -87,10 +86,9 @@ public void onStart(AttributesBuilder attributes, Context parentContext, REQUEST
attributes,
SemanticAttributes.NET_APP_PROTOCOL_VERSION,
getter.getProtocolVersion(request));
internalSet(attributes, SemanticAttributes.MESSAGING_URL, getter.getUrl(request));
internalSet(
attributes,
SemanticAttributes.MESSAGING_CONVERSATION_ID,
SemanticAttributes.MESSAGING_MESSAGE_CONVERSATION_ID,
getter.getConversationId(request));
internalSet(
attributes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,16 @@ public interface MessagingAttributesGetter<REQUEST, RESPONSE> {
@Nullable
String getProtocolVersion(REQUEST request);

/**
* Returns the application protocol used.
*
* @deprecated The {@code messaging.url} attribute was removed without replacement.
*/
@Deprecated
@Nullable
String getUrl(REQUEST request);
default String getUrl(REQUEST request) {
return null;
}

@Nullable
String getConversationId(REQUEST request);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;

@SuppressWarnings("deprecation") // operationName
class MessagingAttributesExtractorTest {

@ParameterizedTest
Expand Down Expand Up @@ -73,8 +72,7 @@ void shouldExtractAllAvailableAttributes(
}
expectedEntries.add(entry(SemanticAttributes.NET_APP_PROTOCOL_NAME, "AMQP"));
expectedEntries.add(entry(SemanticAttributes.NET_APP_PROTOCOL_VERSION, "1.0.0"));
expectedEntries.add(entry(SemanticAttributes.MESSAGING_URL, "http://broker/topic"));
expectedEntries.add(entry(SemanticAttributes.MESSAGING_CONVERSATION_ID, "42"));
expectedEntries.add(entry(SemanticAttributes.MESSAGING_MESSAGE_CONVERSATION_ID, "42"));
expectedEntries.add(entry(SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES, 100L));
expectedEntries.add(
entry(SemanticAttributes.MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES, 10L));
Expand Down Expand Up @@ -149,11 +147,6 @@ public String getProtocolVersion(Map<String, String> request) {
return request.get("protocolVersion");
}

@Override
public String getUrl(Map<String, String> request) {
return request.get("url");
}

@Override
public String getConversationId(Map<String, String> request) {
return request.get("conversationId");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ public String getProtocolVersion(Message<?> message) {
return null;
}

@Nullable
@Override
public String getUrl(Message<?> message) {
return null;
}

@Nullable
@Override
public String getConversationId(Message<?> message) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ public String getProtocolVersion(MessageWithDestination messageWithDestination)
return null;
}

@Nullable
@Override
public String getUrl(MessageWithDestination messageWithDestination) {
return null;
}

@Nullable
@Override
public String getConversationId(MessageWithDestination messageWithDestination) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ public String getProtocolVersion(KafkaProcessRequest request) {
return null;
}

@Override
@Nullable
public String getUrl(KafkaProcessRequest request) {
return null;
}

@Override
@Nullable
public String getConversationId(KafkaProcessRequest request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ public String getProtocolVersion(KafkaProducerRequest request) {
return null;
}

@Override
@Nullable
public String getUrl(KafkaProducerRequest request) {
return null;
}

@Override
@Nullable
public String getConversationId(KafkaProducerRequest request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ public String getProtocolVersion(KafkaReceiveRequest request) {
return null;
}

@Override
@Nullable
public String getUrl(KafkaReceiveRequest request) {
return null;
}

@Override
@Nullable
public String getConversationId(KafkaReceiveRequest request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ public String getProtocolVersion(ChannelAndMethod channelAndMethod) {
return null;
}

@Nullable
@Override
public String getUrl(ChannelAndMethod channelAndMethod) {
return null;
}

@Nullable
@Override
public String getConversationId(ChannelAndMethod channelAndMethod) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ public String getProtocolVersion(DeliveryRequest request) {
return null;
}

@Nullable
@Override
public String getUrl(DeliveryRequest request) {
return null;
}

@Nullable
@Override
public String getConversationId(DeliveryRequest request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ public String getProtocolVersion(ReceiveRequest request) {
return null;
}

@Nullable
@Override
public String getUrl(ReceiveRequest request) {
return null;
}

@Nullable
@Override
public String getConversationId(ReceiveRequest request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ public String getProtocolVersion(MessageExt request) {
return null;
}

@Nullable
@Override
public String getUrl(MessageExt request) {
return null;
}

@Nullable
@Override
public String getConversationId(MessageExt request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ public String getProtocolVersion(SendMessageContext sendMessageContext) {
return null;
}

@Nullable
@Override
public String getUrl(SendMessageContext sendMessageContext) {
return null;
}

@Nullable
@Override
public String getConversationId(SendMessageContext sendMessageContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,12 @@ public String getProtocolVersion(MessageView messageView) {
return null;
}

@Nullable
@Override
public String getUrl(MessageView messageView) {
return null;
}

@Nullable
@Override
public String getConversationId(MessageView messageView) {
return null;
}

@Nullable
@Override
public Long getMessagePayloadSize(MessageView messageView) {
return (long) messageView.getBody().remaining();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,6 @@ public String getProtocolVersion(ReceiveMessageRequest request) {
return null;
}

@Nullable
@Override
public String getUrl(ReceiveMessageRequest request) {
return null;
}

@Nullable
@Override
public String getConversationId(ReceiveMessageRequest request) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,12 @@ public String getProtocolVersion(PublishingMessageImpl message) {
return null;
}

@Nullable
@Override
public String getUrl(PublishingMessageImpl message) {
return null;
}

@Nullable
@Override
public String getConversationId(PublishingMessageImpl message) {
return null;
}

@Nullable
@Override
public Long getMessagePayloadSize(PublishingMessageImpl message) {
return (long) message.getBody().remaining();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ public String getProtocolVersion(MessageWithChannel messageWithChannel) {
return null;
}

@Override
@Nullable
public String getUrl(MessageWithChannel messageWithChannel) {
return null;
}

@Override
@Nullable
public String getConversationId(MessageWithChannel messageWithChannel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,6 @@ public String getProtocolVersion(Message message) {
return null;
}

@Override
@Nullable
public String getUrl(Message message) {
return null;
}

@Override
@Nullable
public String getConversationId(Message message) {
Expand Down

0 comments on commit 998e781

Please sign in to comment.