You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "ldcsaa (via GitHub)" <gi...@apache.org> on 2023/07/26 08:38:41 UTC
[GitHub] [dubbo] ldcsaa commented on issue #12778: Cannot invoke "org.apache.dubbo.common.URL.getSide(String)" because the return value of "org.apache.dubbo.rpc.RpcServiceContext.getUrl()" is null
ldcsaa commented on issue #12778:
URL: https://github.com/apache/dubbo/issues/12778#issuecomment-1651236196
> 没有复现这个问题,我这边是正常获取的,是不是你provider没注册上
我的现象是:
1、consumer启动时向provider查询Meta信息(getMetadataInfo()),provider就进入了自定义过滤器,而这时的RpcContext.getServiceContext()..getUrl()为null
2、正常的服务接口调用不会出现上述问题
3、暂时通过以下代码回避这个问题
```
RpcServiceContext ctx = RpcContext.getServiceContext();
if(ctx.getUrl() == null)
return invoker.invoke(invocation);
```
我的配置文件(只启用dubbo协议):
```
# Consumer
dubbo.metadata-report.address=nacos://nacos:123456@192.168.56.23:8848
dubbo.registry.simplified=true
dubbo.protocol.name=dubbo
dubbo.protocol.port=5001
dubbo.consumer.filter=mdc
dubbo.provider.filter=mdc
# Provider
dubbo.metadata-report.address=nacos://nacos:123456@192.168.56.23:8848
dubbo.registry.simplified=true
dubbo.protocol.name=dubbo
dubbo.protocol.port=5002
dubbo.consumer.filter=mdc
dubbo.provider.filter=mdc
```
--
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