xujianhai666 commented on a change in pull request #1801: add client custom
nameserver TopAddressing
URL: https://github.com/apache/rocketmq/pull/1801#discussion_r385475431
##########
File path:
client/src/main/java/org/apache/rocketmq/client/impl/MQClientAPIImpl.java
##########
@@ -215,20 +216,25 @@ public RemotingClient getRemotingClient() {
public String fetchNameServerAddr() {
try {
String addrs = this.topAddressing.fetchNSAddr();
- if (addrs != null) {
- if (!addrs.equals(this.nameSrvAddr)) {
- log.info("name server address changed, old=" +
this.nameSrvAddr + ", new=" + addrs);
- this.updateNameServerAddressList(addrs);
- this.nameSrvAddr = addrs;
- return nameSrvAddr;
- }
- }
+ return fetchNameServerAddr(addrs);
} catch (Exception e) {
log.error("fetchNameServerAddr Exception", e);
}
return nameSrvAddr;
}
+ public String fetchNameServerAddr(String addrs){
+ if (addrs != null) {
+ if (!addrs.equals(this.nameSrvAddr)) {
Review comment:
why not rename method `onNameServerChange` ? because is just deal with
nameserver change and then update if necessary
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services