You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2022/03/31 05:10:12 UTC

[GitHub] [skywalking-java] kebingxing commented on a change in pull request #134: Feature msg business consumer

kebingxing commented on a change in pull request #134:
URL: https://github.com/apache/skywalking-java/pull/134#discussion_r839172308



##########
File path: apm-sniffer/apm-sdk-plugin/kafka-plugin/src/main/java/org/apache/skywalking/apm/plugin/kafka/KafkaConsumerInterceptor.java
##########
@@ -44,6 +48,17 @@
 
     public static final String OPERATE_NAME_PREFIX = "Kafka/";
     public static final String CONSUMER_OPERATE_NAME = "/Consumer/";
+    private static final Gson GSON = new Gson();
+
+    private static boolean TRACE_MSG_OPEN;
+
+    public KafkaConsumerInterceptor() {
+        try {
+            Class.forName("org.apache.skywalking.apm.toolkit.trace.msg.TraceMsg");

Review comment:
       Thank you for your guidance.
   The original target here, The KafkaConsumerInterceptor can automatically stores trace information into the message that are implemented the TraceMsg interface.
   
   I will optimize this code;  The pseudo-code used is as follows:
   1.  String trace=TraceMsgContext.getCurretTrace();    //provided to obtain trace information
   2.  msg.setTraceData(trace);  // customized trace data  in message body
   3. TraceMsgContext.ConsumerMsgSucceed(msg.getTraceData()) //trace the real result of kafka message processing
   
   In addition, for the scenarios supported by this feature, whether it is valuable~? 
   I submit a discussion  later;
   
   Thank you again for your guidance; and Thank SkyWalking for bringing a lot of value to the project;
   




-- 
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: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org