-
Notifications
You must be signed in to change notification settings - Fork 26.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
isConsumerSide 报 null 问题 #10704
Comments
org/apache/dubbo/rpc/filter/ContextFilter.java:95 看一下这个地方有没有设置进去 |
org/apache/dubbo/rpc/cluster/filter/support/ConsumerContextFilter.java:66 |
还没等执行到这个类的时候 就已经执行上面的方法并报错了 |
你的 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;
}
} |
就拦截打印了一下日志 很简单的 filter |
应该和 #9645 这个 PR 有关系,导致 Dubbo Cluster Filter 没生效,我看下是哪里导致的 |
#10707 这个我先 revert 了 |
Will be fixed in 3.0.13, 3.1.2 |
请问下最后是用什么方式解决的,我是在切换成非admin用户使用时,debug发现这里报错,麻烦告知一下 |
之前修复是在 3.0 分支做的,发版的时候没有合并到新分支。 对应的集成测试用例已经完善,https://github.com/apache/dubbo-samples/pull/586。 |
Environment
Steps to reproduce this issue
不应该报null的地方 却报null了 好多原先好使的 现在都不好使了 3.0.9无问题
Pls. provide [GitHub address] to reproduce this issue.
Expected Behavior
Actual Behavior
If there is an exception, please attach the exception trace:
The text was updated successfully, but these errors were encountered: