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

[ISSUE #8] Offer a more user-friendly format to configure nameserver #171

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

RongtongJin
Copy link
Contributor

What is the purpose of the change

User can config name-server with format host:port,host:port or other list formats and ensure backward compatibility.
ref #8

Brief changelog

Change the injection type from string to List.

Verifying this change

Follow this checklist to help us incorporate your contribution quickly and easily. Notice, it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR.

  • Make sure there is a Github issue filed 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 [ISSUE #123] Fix UnknownException when host config not exist. 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(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist.
  • Run mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle to make sure basic checks pass. Run mvn clean install -DskipITs to make sure unit-test pass. Run mvn clean test-compile failsafe:integration-test to make sure integration-test pass.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

} else {
nameServerToString = nameServer.get(0);
if (nameServerToString.contains(";")) {
log.warn("name-server format `host:port;host:port` is deprecated.");
Copy link
Member

Choose a reason for hiding this comment

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

Should have a recommendation for a newer style.

Copy link
Contributor

Choose a reason for hiding this comment

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

IMO that logic shows a separate property is warranted.

@vongosling vongosling added the enhancement New feature or request label Nov 15, 2019
@vongosling vongosling added this to the 2.1.0 milestone Nov 15, 2019
Copy link
Contributor

@snicoll snicoll left a comment

Choose a reason for hiding this comment

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

I don't think changing the cardinality of the current property is a good idea. I've added a suggestion.

*/
private String nameServer;
private List<String> nameServer;
Copy link
Contributor

Choose a reason for hiding this comment

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

The name seems a bit odd for a collections. Have you considered naming that servers ? If you want to retain backward compatibility, you could deprecate this one with a replacement metadata to servers and then apply the old logic if nameServer is set. If both are set, I would throw an exception.

You could then remove nameServer in the next feature release.

} else {
nameServerToString = nameServer.get(0);
if (nameServerToString.contains(";")) {
log.warn("name-server format `host:port;host:port` is deprecated.");
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO that logic shows a separate property is warranted.

@RongtongJin
Copy link
Contributor Author

I will close this PR. Considering the habit of rocketmq users, I think separate namesever with semicolons is  still a good choice.

@snicoll
Copy link
Contributor

snicoll commented Dec 25, 2019

@RongtongJin I am confused. This issue is closed in 2.1.0 yet it seems you've decided not to do anything. Have I missed something?

@RongtongJin
Copy link
Contributor Author

RongtongJin commented Jan 15, 2020

@snicoll, I apologize for not replying you sooner, I missed your message since I closed this pull request. I think this is a historical problem. Rocketmq users have used the nameserver property for many years (especially in rocketmq main repo), so changing to nameservers does not conform to the habits of rocketmq users. But your advice is very reasonable. I will reopen this pull request firstly and disscuss with the community about this issue.

@RongtongJin RongtongJin reopened this Jan 15, 2020
@vongosling
Copy link
Member

Great, let's hear more from the community.

@RongtongJin RongtongJin modified the milestones: 2.1.0, 2.1.1 Feb 10, 2020
@RongtongJin RongtongJin modified the milestones: 2.1.1, 2.2.0 Jul 16, 2020
@RongtongJin RongtongJin modified the milestones: 2.2.0, 2.2.1 Jan 2, 2021
@RongtongJin RongtongJin removed this from the 2.2.1 milestone Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants