37
37
import javax .jms .MessageListener ;
38
38
import javax .jms .TextMessage ;
39
39
40
+ import org .apache .pekko .Done ;
41
+ import org .apache .pekko .actor .ActorRef ;
42
+ import org .apache .pekko .actor .Props ;
43
+ import org .apache .pekko .actor .Status ;
44
+ import org .apache .pekko .japi .pf .ReceiveBuilder ;
45
+ import org .apache .pekko .pattern .Patterns ;
46
+ import org .apache .pekko .stream .javadsl .Sink ;
40
47
import org .apache .qpid .jms .JmsAcknowledgeCallback ;
41
48
import org .apache .qpid .jms .JmsMessageConsumer ;
42
49
import org .apache .qpid .jms .message .JmsMessage ;
63
70
import org .eclipse .ditto .connectivity .service .messaging .internal .ConnectionFailure ;
64
71
import org .eclipse .ditto .connectivity .service .messaging .internal .RetrieveAddressStatus ;
65
72
import org .eclipse .ditto .connectivity .service .messaging .monitoring .logs .InfoProviderFactory ;
66
- import org .eclipse .ditto .internal .utils .pekko .logging .ThreadSafeDittoLoggingAdapter ;
67
73
import org .eclipse .ditto .internal .utils .config .InstanceIdentifierSupplier ;
74
+ import org .eclipse .ditto .internal .utils .pekko .logging .ThreadSafeDittoLoggingAdapter ;
68
75
import org .eclipse .ditto .internal .utils .tracing .DittoTracing ;
69
76
import org .eclipse .ditto .internal .utils .tracing .span .SpanOperationName ;
70
77
import org .eclipse .ditto .internal .utils .tracing .span .TracingSpans ;
71
78
72
- import org .apache .pekko .Done ;
73
- import org .apache .pekko .actor .ActorRef ;
74
- import org .apache .pekko .actor .Props ;
75
- import org .apache .pekko .actor .Status ;
76
- import org .apache .pekko .japi .pf .ReceiveBuilder ;
77
- import org .apache .pekko .pattern .Patterns ;
78
- import org .apache .pekko .stream .javadsl .Sink ;
79
-
80
79
/**
81
80
* Actor which receives message from an AMQP source and forwards them to a {@code MessageMappingProcessorActor}.
82
81
*/
@@ -342,10 +341,11 @@ private void messageConsumerFailed(final Status.Failure failure) {
342
341
handleAddressStatus (addressStatus );
343
342
}
344
343
345
- private void handleJmsMessage (final JmsMessage message ) {
344
+ private void handleJmsMessage (final JmsMessage message ) throws JMSException {
346
345
Map <String , String > headers = null ;
347
- String correlationId = null ;
348
- var startedSpan = TracingSpans .emptyStartedSpan (SpanOperationName .of ("amqp_consume" ));
346
+ var startedSpan = TracingSpans .emptyStartedSpan (
347
+ SpanOperationName .of ("amqp_consume: " + message .getJMSDestination ())
348
+ );
349
349
try {
350
350
recordIncomingForRateLimit (message .getJMSMessageID ());
351
351
if (logger .isDebugEnabled ()) {
@@ -358,12 +358,16 @@ private void handleJmsMessage(final JmsMessage message) {
358
358
ackType );
359
359
}
360
360
headers = extractHeadersMapFromJmsMessage (message );
361
- correlationId = headers .get (DittoHeaderDefinition .CORRELATION_ID .getKey ());
361
+ final String correlationId = headers .get (DittoHeaderDefinition .CORRELATION_ID .getKey ());
362
362
startedSpan = DittoTracing .newPreparedSpan (headers , startedSpan .getOperationName ())
363
363
.correlationId (correlationId )
364
364
.connectionId (connectionId )
365
365
.start ();
366
- headers = startedSpan .propagateContext (headers );
366
+ headers = startedSpan .propagateContext (DittoHeaders .of (headers )
367
+ .toBuilder ()
368
+ .removeHeader (DittoHeaderDefinition .W3C_TRACEPARENT .getKey ())
369
+ .build ()
370
+ );
367
371
final ExternalMessageBuilder builder = ExternalMessageFactory .newExternalMessageBuilder (headers );
368
372
final ExternalMessage externalMessage = extractPayloadFromMessage (message , builder )
369
373
.withAuthorizationContext (source .getAuthorizationContext ())
0 commit comments