qsliu2017 commented on pull request #7363:
URL: https://github.com/apache/skywalking/pull/7363#issuecomment-886211975


   In rabbitmq client, dispatcher handles a message delivery and calls the 
consumer in a new thread.
   ```java
   package com.rabbitmq.client.impl;
   final class ConsumerDispatcher {
       public void handleDelivery(final Consumer delegate,
                                  final String consumerTag,
                                  final Envelope envelope,
                                  final AMQP.BasicProperties properties,
                                  final byte[] body) throws IOException {
           executeUnlessShuttingDown(
           new Runnable() {
               @Override
               public void run() {
                   try {
                       delegate.handleDelivery(consumerTag,
                               envelope,
                               properties,
                               body);
                   } catch (Throwable ex) {
                       connection.getExceptionHandler().handleConsumerException(
                               channel,
                               ex,
                               delegate,
                               consumerTag,
                               "handleDelivery");
                   }
               }
           });
       }
   }
   ```
   
   ```java
   package com.rabbitmq.client;
   public interface Consumer {
       void handleDelivery(String consumerTag,
                           Envelope envelope,
                           AMQP.BasicProperties properties,
                           byte[] body)
           throws IOException;
   }
   ```
   The existing plugin enhances `Consumer#handleDelivery`, so the consumer span 
is cross-thread, which causes broken traces. @wu-sheng Does this make sense?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to