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

[Dubbo-3370]support 'merge' attribute in @Reference and @Method #4619

Closed
wants to merge 1 commit into from

Conversation

shalk
Copy link

@shalk shalk commented Jul 21, 2019

What is the purpose of the change

to support merge attribute in @Reference and @Method

example:

@RestController
public class MyController {
 
   @Reference(group = "merge,merge3",
            methods = {
                    @Method(name = "mergeResult", merger = "false", retries = 2)})
    MergeService mergeService;

   
    @GetMapping("/merge1")
    public List<String> test() {
        List<String> list = mergeService.mergeResult();
        return list;
    }
}

Brief changelog

  1. add merger field in @Reference and @Method
  2. add unit test in ReferenceConfigTest.java and MethodConfigJava to test getter, setter and construct from annotation
  3. add unit test in AnnotationPropertyValuesAdapterTest.java check databind for merger
  4. add unit test in ReferenceBeanBuilderTest.java to verify referencebean will contain merger info

Verifying this change

unit test :

  • ReferenceConfigTest.java
  • MethodConfigJavaTest.java
  • AnnotationPropertyValuesAdapterTest.java
  • ReferenceBeanBuilderTest.java

Follow this checklist to help us incorporate your contribution quickly and easily:

  • 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.
  • Format the pull request title like [Dubbo-XXX] Fix UnknownException when host config not exist #XXX. 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.
  • 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.
  • Run mvn clean install -DskipTests=false & mvn clean test-compile failsafe:integration-test to make sure unit-test and integration-test pass.
  • If this contribution is large, please follow the Software Donation Guide.

@codecov-io
Copy link

Codecov Report

Merging #4619 into master will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #4619      +/-   ##
============================================
- Coverage     64.17%   64.14%   -0.03%     
  Complexity      452      452              
============================================
  Files           768      768              
  Lines         32873    32869       -4     
  Branches       5181     5179       -2     
============================================
- Hits          21096    21085      -11     
- Misses         9361     9370       +9     
+ Partials       2416     2414       -2
Impacted Files Coverage Δ Complexity Δ
...ache/dubbo/config/spring/util/AnnotationUtils.java 39.21% <ø> (+1.47%) 0 <0> (ø) ⬇️
.../apache/dubbo/qos/protocol/QosProtocolWrapper.java 69.23% <0%> (-12.83%) 0% <0%> (ø)
...onfig/spring/extension/SpringExtensionFactory.java 80.48% <0%> (-4.88%) 0% <0%> (ø)
...bo/rpc/cluster/support/FailbackClusterInvoker.java 67.21% <0%> (-3.28%) 0% <0%> (ø)
...he/dubbo/registry/multicast/MulticastRegistry.java 67.87% <0%> (-1.81%) 0% <0%> (ø)
...g/apache/dubbo/registry/consul/ConsulRegistry.java 61.87% <0%> (-0.63%) 29% <0%> (ø)
.../java/org/apache/dubbo/config/ReferenceConfig.java 59.48% <0%> (-0.37%) 0% <0%> (ø)
.../apache/dubbo/remoting/transport/AbstractPeer.java 71.73% <0%> (+8.69%) 0% <0%> (ø) ⬇️

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 9960d23...306954a. Read the comment docs.

@shalk
Copy link
Author

shalk commented Jul 26, 2019

@chickenlj could you review my code?

@shalk
Copy link
Author

shalk commented Jul 29, 2019

@CLAassistant
Copy link

CLAassistant commented Sep 6, 2019

CLA assistant check
All committers have signed the CLA.

@AlbumenJ
Copy link
Member

This pull request may duplicated with #6092.

Please feel free to reopen if you have any question.

@AlbumenJ AlbumenJ closed this Apr 11, 2021
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.

None yet

4 participants