gzlicanyi commented on code in PR #555:
URL: https://github.com/apache/skywalking-java/pull/555#discussion_r1232134489


##########
apm-sniffer/optional-plugins/optional-spring-plugins/optional-spring-cloud/gateway-2.0.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/spring/cloud/gateway/v20x/HttpClientRequestInterceptor.java:
##########
@@ -80,7 +84,7 @@ public Publisher<Void> apply(final HttpClientRequest 
httpClientRequest) {
             }
         };
 
-        objInst.setSkyWalkingDynamicField(new EnhanceCacheObject(span, 
abstractSpan));
+        ENHANCE_CONTEXT.set(new EnhanceCacheObject(span, abstractSpan));

Review Comment:
   > > That was why we introduced v2. I believe it would make this kind of 
scenarios easier.
   > 
   > I have a question. I just found out in the document that there are both v1 
and v2 versions of ClassEnhancePluginDefine. Do I have to use 
ClassEnhancePluginDefineV2 to define InstanceMethodsAroundInterceptorV2?
   
   ```java
   Caused by: java.lang.ClassCastException: 
org.apache.skywalking.apm.plugin.spring.cloud.gateway.v20x.HttpClientRequestInterceptor
 cannot be cast to 
org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstanceMethodsAroundInterceptor
   ```
   
   From the exception message, it seems that you need to modify the definition.
   
   



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