zhyyu commented on PR #361:
URL: https://github.com/apache/skywalking-java/pull/361#issuecomment-1288631661

   > Does the plugin declear the taget class correctly? You should consider 
whether plugin implementation covers your case or your version. I don't know 
much detail in RocketMQ plugin. As it was added before plugin test mechanism 
existed, I can't tell whether it works or not. This is actually why I 
mentioned, we can't accept more codes until tests added.
   
   I checked the code, the plugin declare the taget class correctly. I even 
changed `rocketmq-client.version` in rocketmq plugin equal to the 
`rocketmq-scenario` 4.9.4. But the consumer class was still not enhanced.
   
   I found, `MQClientAPIImplInstrumentation` enhanceClass byName, It worked, 
and enhanced `MQClientAPIImpl` class is a library class. 
`ConsumeMessageConcurrentlyInstrumentation` enhanceClass byHierarchyMatch, it 
didn't worked, and the enchaned class should be runtime generated class like 
below which implement `MessageListenerConcurrently` interface.
   
   ```java
   consumer.registerMessageListener(new MessageListenerConcurrently() {
         @Override
         public ConsumeConcurrentlyStatus consumeMessage(List<MessageExt> msgs, 
ConsumeConcurrentlyContext context) {
             System.out.printf("%s Receive New Messages: %s %n", 
Thread.currentThread().getName(), new String(msgs.get(0).getBody(), 
StandardCharsets.UTF_8));
             return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
         }
     });                   
   ```
   
   Is it because of some classloader or bytebuddy mechanism why consumer 
listener is not enhanced?


-- 
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