You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2022/10/08 01:28:02 UTC

[GitHub] [dubbo] JavaLionLi opened a new issue, #10704: isConsumerSide 报 null 问题

JavaLionLi opened a new issue, #10704:
URL: https://github.com/apache/dubbo/issues/10704

   <!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
   
   - [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
   
   ### Environment
   
   * Dubbo version: 3.1.1
   * Operating System version: linux
   * Java version: 1.8
   
   ### Steps to reproduce this issue
   
   ![image](https://user-images.githubusercontent.com/31852897/194680205-3f01cc95-7cef-42e3-b784-acac97e37c28.png)
   ![image](https://user-images.githubusercontent.com/31852897/194680478-f890d46d-eb53-42a3-90c8-24325d42b741.png)
   
   不应该报null的地方 却报null了 好多原先好使的 现在都不好使了 3.0.9无问题
   
   Pls. provide [GitHub address] to reproduce this issue.
   
   ### Expected Behavior
   
   <!-- What do you expect from the above steps?-->
   
   ### Actual Behavior
   
   <!-- What actually happens? -->
   
   If there is an exception, please attach the exception trace:
   
   ```
   Just put your stack trace here!
   ```
   


-- 
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@dubbo.apache.org.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] JavaLionLi commented on issue #10704: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
JavaLionLi commented on issue #10704:
URL: https://github.com/apache/dubbo/issues/10704#issuecomment-1272213114

   > > > > > > org/apache/dubbo/rpc/cluster/filter/support/ConsumerContextFilter.java:66 consumer 应该是这个
   > > > > > 
   > > > > > 
   > > > > > 还没等执行到这个类的时候 就已经执行上面的方法并报错了
   > > > > 
   > > > > 
   > > > > 你的 order 是不是 min-value
   > > > 
   > > > 
   > > > 并不是 没有设置order用的默认的
   > > 
   > > 
   > > Filter 整个定义脱敏后发一下
   > 
   > ```/**
    * dubbo日志过滤器
    *
    * @author Lion Li
    */
   @Slf4j
   @Activate(group = {CommonConstants.PROVIDER, CommonConstants.CONSUMER})
   public class DubboRequestFilter implements Filter {
   
       @Override
       public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
           String client = CommonConstants.PROVIDER;
           if (RpcContext.getServiceContext().isConsumerSide()) {
               client = CommonConstants.CONSUMER;
           }
           String baselog = "Client[" + client + "],InterfaceName=[" + invocation.getInvoker().getInterface().getSimpleName() + "],MethodName=[" + invocation.getMethodName() + "]";
           log.info("DUBBO - 服务调用: {},Parameter={}", baselog, invocation.getArguments());
   
           long startTime = System.currentTimeMillis();
           // 执行接口调用逻辑
           Result result = invoker.invoke(invocation);
           // 调用耗时
           long elapsed = System.currentTimeMillis() - startTime;
           // 如果发生异常 则打印异常日志
           if (result.hasException() && invoker.getInterface().equals(GenericService.class)) {
               log.error("DUBBO - 服务异常: {},Exception={}", baselog, result.getException());
           } else {
               log.info("DUBBO - 服务响应: {},SpendTime=[{}ms]", baselog, elapsed);
           }
           return result;
       }
   
   }```


-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] JavaLionLi commented on issue #10704: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
JavaLionLi commented on issue #10704:
URL: https://github.com/apache/dubbo/issues/10704#issuecomment-1319854195

   @AlbumenJ 


-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #10704: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #10704:
URL: https://github.com/apache/dubbo/issues/10704#issuecomment-1272204192

   org/apache/dubbo/rpc/cluster/filter/support/ConsumerContextFilter.java:66
   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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #10704: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #10704:
URL: https://github.com/apache/dubbo/issues/10704#issuecomment-1272208864

   > > org/apache/dubbo/rpc/cluster/filter/support/ConsumerContextFilter.java:66 consumer 应该是这个
   > 
   > 还没等执行到这个类的时候 就已经执行上面的方法并报错了
   
   你的 order 是不是 min-value


-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] JavaLionLi commented on issue #10704: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
JavaLionLi commented on issue #10704:
URL: https://github.com/apache/dubbo/issues/10704#issuecomment-1272192708

   ![image](https://user-images.githubusercontent.com/31852897/194681426-28dcb7e2-d176-472a-8bb0-ddeeeda8f74e.png)
   只要是injvm 获取url全都是null 导致后续所有操作全都报null


-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #10704: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #10704:
URL: https://github.com/apache/dubbo/issues/10704#issuecomment-1272210707

   > > > > org/apache/dubbo/rpc/cluster/filter/support/ConsumerContextFilter.java:66 consumer 应该是这个
   > > > 
   > > > 
   > > > 还没等执行到这个类的时候 就已经执行上面的方法并报错了
   > > 
   > > 
   > > 你的 order 是不是 min-value
   > 
   > 并不是 没有设置order用的默认的
   
   Filter 整个定义脱敏后发一下


-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #10704: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #10704:
URL: https://github.com/apache/dubbo/issues/10704#issuecomment-1272195053

   org/apache/dubbo/rpc/filter/ContextFilter.java:95 看一下这个地方有没有设置进去


-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #10704: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #10704:
URL: https://github.com/apache/dubbo/issues/10704#issuecomment-1272425611

   Will be fixed in 3.0.13, 3.1.2


-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ closed issue #10704: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
AlbumenJ closed issue #10704: isConsumerSide 报  null 问题
URL: https://github.com/apache/dubbo/issues/10704


-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] pzl-1995 commented on issue #10704: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
pzl-1995 commented on issue #10704:
URL: https://github.com/apache/dubbo/issues/10704#issuecomment-1284841740

   请问下最后是用什么方式解决的,我是在切换成非admin用户使用时,debug发现这里报错,麻烦告知一下


-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] JavaLionLi commented on issue #10704: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
JavaLionLi commented on issue #10704:
URL: https://github.com/apache/dubbo/issues/10704#issuecomment-1272212016

   > > > > > org/apache/dubbo/rpc/cluster/filter/support/ConsumerContextFilter.java:66 consumer 应该是这个
   > > > > 
   > > > > 
   > > > > 还没等执行到这个类的时候 就已经执行上面的方法并报错了
   > > > 
   > > > 
   > > > 你的 order 是不是 min-value
   > > 
   > > 
   > > 并不是 没有设置order用的默认的
   > 
   > Filter 整个定义脱敏后发一下
   
   就拦截打印了一下日志 很简单的 filter


-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] JavaLionLi commented on issue #10704: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
JavaLionLi commented on issue #10704:
URL: https://github.com/apache/dubbo/issues/10704#issuecomment-1272208751

   > org/apache/dubbo/rpc/cluster/filter/support/ConsumerContextFilter.java:66 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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #10704: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #10704:
URL: https://github.com/apache/dubbo/issues/10704#issuecomment-1321428073

   之前修复是在 3.0 分支做的,发版的时候没有合并到新分支。
   这个已经修复 https://github.com/apache/dubbo/commit/ae0a371690546ce859f2041814f76dad2c710fd9
   
   对应的集成测试用例已经完善,https://github.com/apache/dubbo-samples/pull/586。


-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] JavaLionLi commented on issue #10704: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
JavaLionLi commented on issue #10704:
URL: https://github.com/apache/dubbo/issues/10704#issuecomment-1319846934

   > Will be fixed in 3.0.13, 3.1.2
   
   升级 3.1.2 依旧报这个错 你上面提交的pr在3.1.2版本里也没有找到 还是本地调用的问题 根本就没有改正过来
   ![image](https://user-images.githubusercontent.com/31852897/202690507-9f9ae810-39da-4d19-898c-0b085a4f83c9.png)
   


-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] JavaLionLi commented on issue #10704: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
JavaLionLi commented on issue #10704:
URL: https://github.com/apache/dubbo/issues/10704#issuecomment-1272211834

   > > > > > org/apache/dubbo/rpc/cluster/filter/support/ConsumerContextFilter.java:66 consumer 应该是这个
   > > > > 
   > > > > 
   > > > > 还没等执行到这个类的时候 就已经执行上面的方法并报错了
   > > > 
   > > > 
   > > > 你的 order 是不是 min-value
   > > 
   > > 
   > > 并不是 没有设置order用的默认的
   > 
   > Filter 整个定义脱敏后发一下
   
   `/**
    * dubbo日志过滤器
    *
    * @author Lion Li
    */
   @Slf4j
   @Activate(group = {CommonConstants.PROVIDER, CommonConstants.CONSUMER})
   public class DubboRequestFilter implements Filter {
   
       @Override
       public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
           String client = CommonConstants.PROVIDER;
           if (RpcContext.getServiceContext().isConsumerSide()) {
               client = CommonConstants.CONSUMER;
           }
           String baselog = "Client[" + client + "],InterfaceName=[" + invocation.getInvoker().getInterface().getSimpleName() + "],MethodName=[" + invocation.getMethodName() + "]";
           log.info("DUBBO - 服务调用: {},Parameter={}", baselog, invocation.getArguments());
   
           long startTime = System.currentTimeMillis();
           // 执行接口调用逻辑
           Result result = invoker.invoke(invocation);
           // 调用耗时
           long elapsed = System.currentTimeMillis() - startTime;
           // 如果发生异常 则打印异常日志
           if (result.hasException() && invoker.getInterface().equals(GenericService.class)) {
               log.error("DUBBO - 服务异常: {},Exception={}", baselog, result.getException());
           } else {
               log.info("DUBBO - 服务响应: {},SpendTime=[{}ms]", baselog, elapsed);
           }
           return result;
       }
   
   }`
   


-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #10704: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #10704:
URL: https://github.com/apache/dubbo/issues/10704#issuecomment-1272259098

   https://github.com/apache/dubbo/pull/10707 这个我先 revert 了


-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] JavaLionLi commented on issue #10704: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
JavaLionLi commented on issue #10704:
URL: https://github.com/apache/dubbo/issues/10704#issuecomment-1272197201

   > org/apache/dubbo/rpc/filter/ContextFilter.java:95 看一下这个地方有没有设置进去
   
   ![image](https://user-images.githubusercontent.com/31852897/194682666-9b05c3bf-829c-431a-813c-280870ee4a31.png)
   这个只有PROVIDER有效 我现在想在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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] JavaLionLi commented on issue #10704: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
JavaLionLi commented on issue #10704:
URL: https://github.com/apache/dubbo/issues/10704#issuecomment-1272193787

   ![image](https://user-images.githubusercontent.com/31852897/194681608-5beb2b6e-9085-4c00-8d8e-f722131f7b7b.png)


-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] JavaLionLi commented on issue #10704: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
JavaLionLi commented on issue #10704:
URL: https://github.com/apache/dubbo/issues/10704#issuecomment-1272208959

   > > > org/apache/dubbo/rpc/cluster/filter/support/ConsumerContextFilter.java:66 consumer 应该是这个
   > > 
   > > 
   > > 还没等执行到这个类的时候 就已经执行上面的方法并报错了
   > 
   > 你的 order 是不是 min-value
   
   并不是 没有设置order用的默认的


-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] AlbumenJ commented on issue #10704: isConsumerSide 报 null 问题

Posted by GitBox <gi...@apache.org>.
AlbumenJ commented on issue #10704:
URL: https://github.com/apache/dubbo/issues/10704#issuecomment-1272213667

   应该和 https://github.com/apache/dubbo/pull/9645 这个 PR 有关系,导致 Dubbo Cluster Filter 没生效,我看下是哪里导致的


-- 
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@dubbo.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org