dubbo
dubbo copied to clipboard
InjvmInvoker throw Exception that message is "No Provider ..." with consumer refer DubboService use "*"
- [ ] I have searched the issues of this repository and believe that this is not a duplicate.
Environment
- Dubbo version: 3.1.6
- Operating System version: mac 12.6
- Java version: 1.8
Steps to reproduce this issue
- two providers export injvm DubboService : com.test.TestService:1.0.0 and com.test.TestService
- consumer refer injvm DubboService: com.test.TestService:*
- consumer call DubboService com.test.TestService.test()
Pls. provide [GitHub address] to reproduce this issue.
Expected Behavior
consumer call provider success.
Actual Behavior
throw Exception and the message is "No Provider".
If there is an exception, please attach the exception trace:
Just put your stack trace here!
This seem that we need to support group merge for injvm protocol?
It support group, but InjvmInvoker.isAvailable() is not support the wildcard ("*"), because the code logic of InjvmInvoker.isAvailable() is inconsistent with InjvmInvoker.doInvoke(). the code of InjvmInvoker.isAvailable() :
public boolean isAvailable() {
InjvmExporter<?> exporter = (InjvmExporter)this.exporterMap.get(this.key);
return exporter == null ? false : super.isAvailable();
}
the code of InjvmInvoker.doInvoke():
public Result doInvoke(Invocation invocation) throws Throwable {
Exporter<?> exporter = InjvmProtocol.getExporter(this.exporterMap, this.getUrl());
if (exporter == null) {
throw new RpcException("Service [" + this.key + "] not found.");
} else {
...
}
}
PR https://github.com/apache/dubbo/pull/13716 is fix it. please
It support group, but InjvmInvoker.isAvailable() is not support the wildcard ("*"), because the code logic of InjvmInvoker.isAvailable() is inconsistent with InjvmInvoker.doInvoke(). the code of InjvmInvoker.isAvailable() :
public boolean isAvailable() { InjvmExporter<?> exporter = (InjvmExporter)this.exporterMap.get(this.key); return exporter == null ? false : super.isAvailable(); }
the code of InjvmInvoker.doInvoke():
public Result doInvoke(Invocation invocation) throws Throwable { Exporter<?> exporter = InjvmProtocol.getExporter(this.exporterMap, this.getUrl()); if (exporter == null) { throw new RpcException("Service [" + this.key + "] not found."); } else { ... } }
PR #13716 is fix it. please
I think we should create a directory for it like those provider registered in registry.
e.g. org.apache.dubbo.registry.integration.RegistryDirectory#toMergeInvokerList
It support group, but InjvmInvoker.isAvailable() is not support the wildcard ("*"), because the code logic of InjvmInvoker.isAvailable() is inconsistent with InjvmInvoker.doInvoke(). the code of InjvmInvoker.isAvailable() :
public boolean isAvailable() { InjvmExporter<?> exporter = (InjvmExporter)this.exporterMap.get(this.key); return exporter == null ? false : super.isAvailable(); }
the code of InjvmInvoker.doInvoke():
public Result doInvoke(Invocation invocation) throws Throwable { Exporter<?> exporter = InjvmProtocol.getExporter(this.exporterMap, this.getUrl()); if (exporter == null) { throw new RpcException("Service [" + this.key + "] not found."); } else { ... } }
PR #13716 is fix it. please
I think we should create a directory for it like those provider registered in registry.
goods idea, we should support it for consumer refer use wildcard either on "group" or "version" or both in the best.