dubbo icon indicating copy to clipboard operation
dubbo copied to clipboard

fix just consumers unregister serviceInstance

Open xieshouyu opened this issue 1 year ago • 12 comments

What is the purpose of the change

1、fix just consumers unregister serviceInstance

Brief changelog

1、set ServiceInstanceHostPortCustomizer Prioritized 2、add ServiceInstanceConsumerHostPortCustomizer fix just consumers unregister serviceInstance

Verifying this change

Start the consumer application, and the host and port will be registered

Checklist

  • [x] 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.

xieshouyu avatar Jan 23 '24 03:01 xieshouyu

Kindly incorporate additional contextual information to the purpose. Additionally, please include some test examples for comprehensive coverage.

mytang0 avatar Jan 26 '24 04:01 mytang0

@chickenlj PTAL

AlbumenJ avatar Jan 26 '24 07:01 AlbumenJ

Kindly incorporate additional contextual information to the purpose. Additionally, please include some test examples for comprehensive coverage.

The original interface level can support querying all consumers corresponding to the provider interface. After forcing the application level, we are unable to obtain real-time subscription data for consumers. By registering the serviceInstance of the consumer, the admin can obtain the corresponding serviceInstance, thereby obtaining real-time subscription data.

xieshouyu avatar Jan 26 '24 08:01 xieshouyu

Kindly incorporate additional contextual information to the purpose. Additionally, please include some test examples for comprehensive coverage.

Obtaining all consumers information of the provider interface can better manage internal interfaces. For example, providing a reference for an offline interface. I think this is the original advantage compared to the Spring Cloud system.

xieshouyu avatar Jan 26 '24 08:01 xieshouyu

add unit test

xieshouyu avatar Jan 31 '24 01:01 xieshouyu

image

Please fix failed test cases.

AlbumenJ avatar Jan 31 '24 02:01 AlbumenJ

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (2cf54f7) 70.37% compared to head (a9cf89a) 70.33%. Report is 6 commits behind head on 3.2.

:exclamation: Current head a9cf89a differs from pull request most recent head 95469d1. Consider uploading reports for the commit 95469d1 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##              3.2   #13685      +/-   ##
==========================================
- Coverage   70.37%   70.33%   -0.05%     
==========================================
  Files        1606     1607       +1     
  Lines       70032    70062      +30     
  Branches    10104    10110       +6     
==========================================
- Hits        49287    49280       -7     
- Misses      16108    16145      +37     
  Partials     4637     4637              

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Jan 31 '24 10:01 codecov-commenter

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

2 New issues
0 Security Hotspots
73.6% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud

sonarqubecloud[bot] avatar Jan 31 '24 10:01 sonarqubecloud[bot]

Thanks for the contribution. Could you please explain in what scenario we would need this?

chickenlj avatar Feb 02 '24 07:02 chickenlj

Thanks for the contribution. Please explain in what scenario we would need this.

chickenlj avatar Feb 02 '24 07:02 chickenlj

Thanks for the contribution. Could you please explain in what scenario we would need this?

Prerequisite: dubbo.application.register-mode=instance

For example, when we want to know in admin which business consumers a certain provider interface has. If only the consumer application is not registered, the admin will not be able to access all the data of business consumers.

xieshouyu avatar Feb 06 '24 04:02 xieshouyu