-
Notifications
You must be signed in to change notification settings - Fork 26.4k
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
[Dubbo-1876] Enhancements for the new async way of Dubbo #1957
Conversation
# Conflicts: # dubbo-rpc/dubbo-rpc-api/pom.xml
…develop-async-response
# Conflicts: # dubbo-cluster/src/main/java/com/alibaba/dubbo/rpc/cluster/support/ClusterUtils.java # dubbo-common/src/main/java/com/alibaba/dubbo/common/Constants.java # dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/ReferenceConfig.java # dubbo-demo/dubbo-demo-api/src/main/java/com/alibaba/dubbo/demo/DemoService.java # dubbo-demo/dubbo-demo-consumer/src/main/java/com/alibaba/dubbo/demo/consumer/Consumer.java # dubbo-demo/dubbo-demo-provider/src/main/java/com/alibaba/dubbo/demo/provider/DemoServiceImpl.java # dubbo-demo/dubbo-demo-provider/src/main/resources/META-INF/spring/dubbo-demo-provider.xml # dubbo-registry/dubbo-registry-api/src/main/java/com/alibaba/dubbo/registry/integration/RegistryProtocol.java # dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/exchange/ExchangeHandler.java # dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/exchange/support/ExchangeHandlerAdapter.java # dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/exchange/support/ExchangeHandlerDispatcher.java # dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/exchange/support/header/HeaderExchangeChannel.java # dubbo-remoting/dubbo-remoting-api/src/main/java/com/alibaba/dubbo/remoting/exchange/support/header/HeaderExchangeHandler.java # dubbo-remoting/dubbo-remoting-api/src/test/java/com/alibaba/dubbo/remoting/PerformanceServerTest.java # dubbo-remoting/dubbo-remoting-api/src/test/java/com/alibaba/dubbo/remoting/handler/HeaderExchangeHandlerTest.java # dubbo-remoting/dubbo-remoting-netty/src/test/java/com/alibaba/dubbo/remoting/exchange/support/header/HeartbeatHandlerTest.java # dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/Result.java # dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/RpcContext.java # dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/RpcResult.java # dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/filter/ConsumerContextFilter.java # dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/filter/ContextFilter.java # dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/filter/ExceptionFilter.java # dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/proxy/AbstractProxyFactory.java # dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/proxy/AbstractProxyInvoker.java # dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/proxy/InvokerInvocationHandler.java # dubbo-rpc/dubbo-rpc-api/src/main/java/com/alibaba/dubbo/rpc/support/RpcUtils.java # dubbo-rpc/dubbo-rpc-dubbo/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/DubboCodec.java # dubbo-rpc/dubbo-rpc-dubbo/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/DubboInvoker.java # dubbo-rpc/dubbo-rpc-dubbo/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/DubboProtocol.java # dubbo-rpc/dubbo-rpc-dubbo/src/main/java/com/alibaba/dubbo/rpc/protocol/dubbo/FutureAdapter.java # dubbo-rpc/dubbo-rpc-thrift/src/main/java/com/alibaba/dubbo/rpc/protocol/thrift/ThriftProtocol.java # dubbo-test/dubbo-test-benchmark/pom.xml # dubbo-test/dubbo-test-benchmark/src/main/java/com/alibaba/dubbo/rpc/benchmark/AbstractBenchmarkServer.java
# Conflicts: # dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AsyncContext.java # dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/AsyncContextImpl.java
Codecov Report
@@ Coverage Diff @@
## master #1957 +/- ##
============================================
+ Coverage 53.07% 53.07% +<.01%
- Complexity 4930 4956 +26
============================================
Files 557 559 +2
Lines 24802 24892 +90
Branches 4427 4431 +4
============================================
+ Hits 13164 13212 +48
- Misses 9618 9660 +42
Partials 2020 2020
Continue to review full report at Codecov.
|
# Conflicts: # dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/support/DemoService.java # dubbo-rpc/dubbo-rpc-api/src/test/java/org/apache/dubbo/rpc/support/DemoServiceImpl.java
Looks fantastic! This new async way of Dubbo is quite amazing! (It may be better to squash the commits into one commit) |
An article introducing the new async way was recorded here, written in Chinese. |
Thank @hengyunabc for help reviewing, he totally agrees with the new async way showed in the demo. |
# Conflicts: # dubbo-rpc/dubbo-rpc-thrift/src/main/java/org/apache/dubbo/rpc/protocol/thrift/ThriftProtocol.java
* commit 'b055991b317f4e58d256721875a00c52fe415510': (271 commits) Merge pull request apache#1957, enhancements for the new async way of Dubbo. rename log file from alibaba to custom-access (apache#2057) Merge pull request apache#2049, upgrade netty4 to the latest release and make it the default option for transporter. Format style. Restore the badges in README. Polish README. Refactor README. Merge pull request apache#2047, deprecate dubbo-rpc-thrift. Merge pull request apache#2005, change maven parent from sonatype to apache. rename access log in unit test from 'alibaba' to 'alibaba.log' so that it cannot be committed by accident. (apache#2051) add test cases for injvm rpc protocol (apache#2041) add test cases for rpc thrift protocol (apache#2042) Merge pull request apache#1966, introduces dubbo metrics API module. [Dubbo- unit test class not found] fix class not found "hi" (apache#2034) add README for compatible module (apache#2019) Polish README. update README (apache#2025) [Dubbo-1695] Enhance the test coverage part-16 : dubbo-rpc/dubbo-rpc-api module (apache#2004) Merge pull request apache#1997, clienthandler in netty4 should trigger heartbeat handler. Update issue template description. ...
What is the purpose of the change
Enhancements for the new async way of Dubbo introduced in #1876. Below is the main issues this PR trys to solve:
Brief changelog
Add AsyncRpcResult to represent result value of async invoke, equivalent to RpcResult for sync invoke.
Add PostProcessFilter to support postprocess of result in filter chain
Change AbstractProxyInvoker and DubboInvoker to support services with original Future signature, supplementary for generated Future service.
Verifying this change
Follow this checklist to help us incorporate your contribution quickly and easily:
[Dubbo-XXX] Fix UnknownException when host config not exist #XXX
. Each commit in the pull request should have a meaningful subject line and body.mvn clean install -DskipTests
&mvn clean test-compile failsafe:integration-test
to make sure unit-test and integration-test pass.