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/02/11 05:39:12 UTC

[GitHub] [skywalking-java] honganan commented on a change in pull request #110: fix Dubbo3.x Context problem #8525

honganan commented on a change in pull request #110:
URL: https://github.com/apache/skywalking-java/pull/110#discussion_r804369957



##########
File path: apm-sniffer/apm-sdk-plugin/dubbo-3.x-plugin/src/main/java/org/apache/skywalking/apm/plugin/asf/dubbo3/DubboInterceptor.java
##########
@@ -151,6 +137,19 @@ private void dealException(Throwable throwable) {
         span.log(throwable);
     }
 
+    /**
+     * to judge if current is in provider side.
+     *
+     * @param rpcInvocation
+     * @return
+     */
+    private static boolean isProvider(RpcInvocation rpcInvocation) {
+        Invoker<?> invoker = rpcInvocation.getInvoker();
+        return invoker.getUrl()
+                .getParameter("side", "consumer")
+                .equals("provider");

Review comment:
       We can wait for the Dubbo team...
   I write this from my understanding to the scope of `Rpc*Context` and `RpcInvocation`. 
    The `RpcServiceContext#isConsumerSide()` implements like:
   ```java
   public boolean isConsumerSide() {
           return this.getUrl().getSide("provider").equals("consumer");
   }
   ```




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