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

Revert #3688 config-center-config #3853

Merged
merged 2 commits into from
Apr 12, 2019
Merged

Conversation

chickenlj
Copy link
Contributor

What is the purpose of the change

see issue described here #3682

Brief changelog

XXXXX

Verifying this change

XXXXX

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 integration-test in test module.
  • 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.

@chickenlj
Copy link
Contributor Author

/**
     * if {@link #key()} is specified, it will be used as the key for the annotated property when generating url.
     * by default, this key will also be used to retrieve the config value:
     * <pre>
     * {@code
     *  class ExampleConfig {
     *      // Dubbo will try to get "dubbo.example.alias_for_item=xxx" from .properties, if you want to use the original property
     *      // "dubbo.example.item=xxx", you need to set useKeyAsProperty=false.
     *      @Parameter(key = "alias_for_item")
     *      public getItem();
     *  }
     * }
     *
     * </pre>
     */
    boolean useKeyAsProperty() default true;	    boolean useKeyAsProperty() default true;

@chickenlj
Copy link
Contributor Author

chickenlj commented Apr 11, 2019

class ExampleConfig {
      // Dubbo will try to get "dubbo.example.alias_for_item=xxx" from .properties, if you want to use the original property
     // "dubbo.example.item=xxx", you need to set useKeyAsProperty=false.
     @Parameter(key = "alias_for_item")
    public getItem() {
      return "xxx";
    }
}

Only key is set or not matters:

URL: dubbo://xxxxx?alias_for_item=xxxx
# when useKeyAsProperty=true.
dubbo.example.alias_for_item=xxx
# useKeyAsProperty=false.
dubbo.example.item=xxx

Copy link
Contributor

@ralf0131 ralf0131 left a comment

Choose a reason for hiding this comment

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

I got what you mean, I think it is reasonable to revert it.

@ralf0131
Copy link
Contributor

@tswstarplanet Could you please verify it?

@ralf0131
Copy link
Contributor

@tswstarplanet I am merging it, please feel free to reopen this, if you have any issues.

@ralf0131 ralf0131 merged commit a0f3408 into apache:master Apr 12, 2019
vio-lin pushed a commit to vio-lin/incubator-dubbo that referenced this pull request Apr 29, 2019
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