wu-sheng commented on code in PR #460:
URL: https://github.com/apache/skywalking-java/pull/460#discussion_r1112484372


##########
apm-sniffer/apm-sdk-plugin/servicecomb-plugin/servicecomb-java-chassis-2.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/servicecomb/v2/ProducerOperationHandlerInterceptor.java:
##########
@@ -40,9 +39,14 @@ public void beforeMethod(EnhancedInstance objInst, Method 
method, Object[] allAr
         Invocation invocation = (Invocation) allArguments[0];
         ContextCarrier contextCarrier = new ContextCarrier();
         CarrierItem next = contextCarrier.items();
+        boolean inContext = isInContext(invocation);
         while (next.hasNext()) {
             next = next.next();
-            next.setHeadValue(invocation.getContext().get(next.getHeadKey()));
+            if (inContext) {
+                
next.setHeadValue(invocation.getContext().get(next.getHeadKey()));
+            }else {
+                invocation.getRequestEx().getHeader(next.getHeadKey());
+            }

Review Comment:
   If you want to fail back, don't try to on your own, try to get from context, 
if empty or null, fall back to from request ext
   
   But still, your codes don't show logic about why this is putting in two 
places, because client side code doesn't show difference.
   
   



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