Github user qqeasonchen commented on a diff in the pull request:

    https://github.com/apache/incubator-rocketmq/pull/139#discussion_r131060698
  
    --- Diff: 
client/src/main/java/org/apache/rocketmq/client/impl/factory/MQClientInstance.java
 ---
    @@ -255,19 +255,17 @@ public void start() throws MQClientException {
         }
     
         private void startScheduledTask() {
    -        if (null == this.clientConfig.getNamesrvAddr()) {
    --- End diff --
    
    @shroman @Jaskey 
    sure the design is ok, but i think you guys didn't catch my question, there 
is a bug here : 
    if i didn't specified nameserver address and choose to fetch dynamically, 
but infact
    when client start ,if nameserver address is null ,it will fetch it first
    // If not specified,looking address from name server
    if (null == this.clientConfig.getNamesrvAddr()) { 
this.mQClientAPIImpl.fetchNameServerAddr(); }
    
    and then in startScheduledTask(), the schedule task will not be started 
because just now fetch it
    so the client will not be able to fetch nameserver dynamically.
    hope make it clear about my question.
    
    private void startScheduledTask() {
            if (null == this.clientConfig.getNamesrvAddr()) {
                this.scheduledExecutorService.scheduleAtFixedRate(new 
Runnable() {
    
                    @Override
                    public void run() {
                        try {
                            
MQClientInstance.this.mQClientAPIImpl.fetchNameServerAddr();
                        } catch (Exception e) {
                            log.error("ScheduledTask fetchNameServerAddr 
exception", e);
                        }
                    }
                }, 1000 * 10, 1000 * 60 * 2, TimeUnit.MILLISECONDS);
            }



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to