You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2020/02/28 02:10:28 UTC

[GitHub] [rocketmq] xujianhai666 commented on a change in pull request #1801: add client custom nameserver TopAddressing

xujianhai666 commented on a change in pull request #1801: add client custom nameserver TopAddressing
URL: https://github.com/apache/rocketmq/pull/1801#discussion_r385474451
 
 

 ##########
 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:
   maybe we could combine two statements info one.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services