Skip to content

Dubbo 2.7.0的provider无法指定客户端默认async #3650

Closed
@haiyang1985

Description

@haiyang1985
  • 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

  1. start provider and specific async as true, <dubbo:service interface="" async="true">
  2. start consumer without async specific.
  3. 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!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions