Description
- I have searched the issues of this repository and believe that this is not a duplicate.
- I have checked the FAQ of this repository and believe that this is not a duplicate.
Environment
- Dubbo version: 2.7.0
- Operating System version: macOS Sierra 10.12
- Java version: 1.8.0_111
Steps to reproduce this issue
- start provider and specific async as true, <dubbo:service interface="" async="true">
- start consumer without async specific.
- send a request
Pls. provide [GitHub address] to reproduce this issue.
Expected Result
What do you expected from the above steps?
We are able to get the value from the CompletableFuture.
service.sayHello(input);
CompletableFuture future = RpcContext.getContext().getCompletableFuture();
future.whenComplete((retValue, error) -> {
System.out.println(retValue);
});
Actual Result
What actually happens?
It throws NPE exception as following, as we are not able to get the future.
Exception in thread "main" java.lang.NullPointerException
With investigation, it's an issue in RegistryDirectory.
Also, we are able to get async=true from providerUrl, but the querymap's async is false from consumer side. It changed the async from true to false, and caused the issue.
private URL mergeUrl(URL providerUrl) {
providerUrl = ClusterUtils.mergeUrl(providerUrl, queryMap);
}
If there is an exception, please attach the exception trace:
Just put your stack trace here!