Skip to content
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

Add 3.0 Multi Instance Support #8662

Merged
merged 76 commits into from
Sep 2, 2021
Merged

Add 3.0 Multi Instance Support #8662

merged 76 commits into from
Sep 2, 2021

Conversation

AlbumenJ
Copy link
Member

@AlbumenJ AlbumenJ commented Sep 2, 2021

What is the purpose of the change

Brief changelog

Verifying this change

Checklist

  • Make sure there is a GitHub_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GitHub issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Add some description to dubbo-website project if you are requesting to add a feature.
  • GitHub Actions works fine on your own branch.
  • If this contribution is large, please follow the Software Donation Guide.

kylixs and others added 30 commits August 19, 2021 20:27
AlbumenJ and others added 22 commits August 30, 2021 17:44
# Conflicts:
#	dubbo-common/src/main/java/org/apache/dubbo/common/constants/CommonConstants.java
#	dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/ReferenceConfig.java
#	dubbo-config/dubbo-config-api/src/main/java/org/apache/dubbo/config/bootstrap/DubboBootstrap.java
#	dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/ReferenceConfigTest.java
#	dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/integration/multiple/servicediscoveryregistry/MultipleRegistryCenterServiceDiscoveryRegistryRegistryServiceListener.java
#	dubbo-config/dubbo-config-spring/src/test/java/org/apache/dubbo/config/spring/reference/javaconfig/JavaConfigReferenceBeanTest.java
#	dubbo-metadata/dubbo-metadata-api/src/main/java/org/apache/dubbo/metadata/report/MetadataReportInstance.java
#	dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/DefaultServiceInstance.java
#	dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/ServiceDiscoveryRegistryDirectory.java
#	dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/MetadataServiceNameMapping.java
#	dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/ServiceInstanceMetadataCustomizer.java
#	dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/metadata/ServiceInstanceMetadataUtils.java
#	dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java
#	dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/support/CacheableFailbackRegistry.java
#	dubbo-registry/dubbo-registry-api/src/test/java/org/apache/dubbo/registry/client/DefaultServiceInstanceTest.java
#	dubbo-registry/dubbo-registry-api/src/test/java/org/apache/dubbo/registry/client/migration/MigrationRuleListenerTest.java
#	dubbo-registry/dubbo-registry-api/src/test/java/org/apache/dubbo/registry/client/migration/model/MigrationRuleTest.java
#	dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosServiceDiscovery.java
#	dubbo-registry/dubbo-registry-zookeeper/src/main/java/org/apache/dubbo/registry/zookeeper/util/CuratorFrameworkUtils.java
#	dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/DecodeableRpcResult.java
# Conflicts:
#	dubbo-common/src/main/java/org/apache/dubbo/common/URLBuilder.java
#	dubbo-common/src/main/java/org/apache/dubbo/common/url/component/ServiceConfigURL.java
#	dubbo-config/dubbo-config-api/src/test/java/org/apache/dubbo/config/ReferenceConfigTest.java
#	dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/client/ServiceDiscoveryRegistryDirectory.java
#	dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryDirectory.java
#	dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java
@codecov-commenter
Copy link

codecov-commenter commented Sep 2, 2021

Codecov Report

Merging #8662 (a68aee9) into 3.0 (b8de0a7) will increase coverage by 0.11%.
The diff coverage is 72.20%.

Impacted file tree graph

@@             Coverage Diff              @@
##                3.0    #8662      +/-   ##
============================================
+ Coverage     63.49%   63.61%   +0.11%     
  Complexity      312      312              
============================================
  Files          1121     1138      +17     
  Lines         46975    47607     +632     
  Branches       7093     7157      +64     
============================================
+ Hits          29829    30283     +454     
- Misses        13846    14003     +157     
- Partials       3300     3321      +21     
Impacted Files Coverage Δ
...e/dubbo/rpc/cluster/filter/FilterChainBuilder.java 56.52% <ø> (ø)
...c/cluster/governance/GovernanceRuleRepository.java 100.00% <ø> (ø)
...o/rpc/cluster/support/wrapper/AbstractCluster.java 22.36% <0.00%> (ø)
.../apache/dubbo/common/beans/ScopeBeanException.java 0.00% <0.00%> (ø)
...mon/beans/factory/ScopeBeanFactoryInitializer.java 0.00% <0.00%> (ø)
...apache/dubbo/common/constants/CommonConstants.java 100.00% <ø> (ø)
...ava/org/apache/dubbo/common/convert/Converter.java 76.92% <ø> (ø)
...o/common/convert/multiple/MultiValueConverter.java 58.33% <ø> (ø)
...n/java/org/apache/dubbo/config/RegistryConfig.java 91.12% <ø> (ø)
...org/apache/dubbo/rpc/model/ScopeModelAccessor.java 0.00% <0.00%> (ø)
... and 202 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b8de0a7...a68aee9. Read the comment docs.

@AlbumenJ AlbumenJ merged commit ff39bf3 into 3.0 Sep 2, 2021
@AlbumenJ AlbumenJ deleted the 3.0-multi-instances branch September 2, 2021 09:54
@zrlw
Copy link
Contributor

zrlw commented Sep 2, 2021

ReferenceConfig.java

// TODO, uncomment this line once service key is unified
serviceMetadata.setServiceKey(URL.buildKey(interfaceName, group, version));

一个工程如果有多个Reference引用同一个服务接口,配置的回调onXXX各自不同,ReferenceConfig只存一份consumerModel是搞不定的

@AlbumenJ
Copy link
Member Author

AlbumenJ commented Sep 2, 2021

ReferenceConfig.java

// TODO, uncomment this line once service key is unified
serviceMetadata.setServiceKey(URL.buildKey(interfaceName, group, version));

一个工程如果有多个Reference引用同一个服务接口,配置的回调onXXX各自不同,ReferenceConfig只存一份consumerModel是搞不定的

这个 PR 只是基础代码,最后的版本多个 ReferenceConfig 之间可以独立工作

@kylixs kylixs restored the 3.0-multi-instances branch September 2, 2021 12:27
@zrlw
Copy link
Contributor

zrlw commented Sep 3, 2021

做了一下3.0多实例的同一接口多引用测试, 测试结果很完美,测试代码见 #8670
非常期待早日发布具备同样功能的2.7.14! #8567#8602 两个问题就可以关掉啦

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants