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

support dubbo.registry.parameters.item3=value3 configuration properties #8308

Merged
merged 3 commits into from
Jul 20, 2021

Conversation

xiaoheng1
Copy link
Contributor

What is the purpose of the change

Support the following format configuration properties. such as:

dubbo.registry.parameters.item3=value3

see #8303

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.

@codecov-commenter
Copy link

codecov-commenter commented Jul 17, 2021

Codecov Report

Merging #8308 (806f8ab) into 3.0 (b4d72f9) will decrease coverage by 0.12%.
The diff coverage is 91.66%.

Impacted file tree graph

@@             Coverage Diff              @@
##                3.0    #8308      +/-   ##
============================================
- Coverage     64.05%   63.92%   -0.13%     
+ Complexity      313      311       -2     
============================================
  Files          1077     1078       +1     
  Lines         45518    45741     +223     
  Branches       6839     6864      +25     
============================================
+ Hits          29155    29241      +86     
- Misses        13138    13235      +97     
- Partials       3225     3265      +40     
Impacted Files Coverage Δ
...c/main/java/org/apache/dubbo/config/Constants.java 100.00% <ø> (ø)
...apache/dubbo/common/config/ConfigurationUtils.java 76.59% <91.66%> (+0.45%) ⬆️
...n/java/org/apache/dubbo/config/AbstractConfig.java 80.62% <91.66%> (-0.08%) ⬇️
...nfigcenter/nop/NopDynamicConfigurationFactory.java 50.00% <0.00%> (-50.00%) ⬇️
...nfig/configcenter/nop/NopDynamicConfiguration.java 25.00% <0.00%> (-37.50%) ⬇️
...figcenter/AbstractDynamicConfigurationFactory.java 75.00% <0.00%> (-25.00%) ⬇️
...ache/dubbo/qos/command/util/ServiceCheckUtils.java 0.00% <0.00%> (-11.77%) ⬇️
...in/java/org/apache/dubbo/common/utils/JVMUtil.java 81.13% <0.00%> (-11.33%) ⬇️
...e/dubbo/remoting/transport/netty/NettyChannel.java 52.27% <0.00%> (-7.96%) ⬇️
...mmon/config/configcenter/DynamicConfiguration.java 72.22% <0.00%> (-7.78%) ⬇️
... and 63 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 b4d72f9...806f8ab. Read the comment docs.

@@ -559,6 +560,13 @@ public void refresh() {
postProcessRefresh();
}

private void invokeSetParameters(Map<String, String> values) {
Map<String, String> map = invokeGetParameters(getClass(), this);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to check argument Map<String, String> values, If it is null or empty, just return

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, i will modify it.

invokeSetParameters(convert(StringUtils.parseParameters(value), ""));
} else {
// in this case, maybe parameters.item3=value3.
invokeSetParameters(ConfigurationUtils.getSubProperties(subProperties, PARAMETERS));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we do convert() parameters or not?
For compatibility, convert is needed, but additional parameters will be added, which leads to more url parameters, which is not good. This compatibility does not know what the specific problem is, it is best to deal with it when the parameters are read.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some use a.b, some a-b, we will normalize parameter keys later.

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.

3 participants