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 2019/09/16 07:04:39 UTC

[GitHub] [rocketmq] duhenglucky commented on a change in pull request #1458: [ISSUE #1457] Dynamically effective namesrvAddr for name server auto-scaling

duhenglucky commented on a change in pull request #1458: [ISSUE #1457] Dynamically effective namesrvAddr for name server auto-scaling
URL: https://github.com/apache/rocketmq/pull/1458#discussion_r324529505
 
 

 ##########
 File path: broker/src/main/java/org/apache/rocketmq/broker/BrokerController.java
 ##########
 @@ -388,6 +388,20 @@ public void run() {
                 }
             }, 1000 * 10, 1000 * 60, TimeUnit.MILLISECONDS);
 
+            if (this.brokerConfig.isWatchNamesrvAddr()) {
+                this.scheduledExecutorService.scheduleAtFixedRate(new Runnable() {
+
+                    @Override
+                    public void run() {
+                        try {
+                            BrokerController.this.brokerOuterAPI.updateNameServerAddressList(brokerConfig.getNamesrvAddr());
+                        } catch (Throwable e) {
+                            log.error("ScheduledTask updateNameServerAddressList exception", e);
+                        }
+                    }
+                }, 1, 1, TimeUnit.MINUTES);
 
 Review comment:
   It would be better to keep consistent with the scheduled tasks in org.apache.rocketmq.broker.BrokerController#initialize(fetchNameServerAddr task)

----------------------------------------------------------------
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