Skip to content

Commit

Permalink
[ISSUE #7497] Extract the frequency of calling updateNamesrvAddr into…
Browse files Browse the repository at this point in the history
… a configuration (#7498)

merge
  • Loading branch information
xdkxlk authored Oct 24, 2023
1 parent 38d2676 commit f90c553
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public void run0() {
LOG.error("ScheduledTask fetchNameServerAddr exception", e);
}
}
}, 1000 * 10, 1000 * 60 * 2, TimeUnit.MILLISECONDS);
}, 1000 * 10, this.brokerContainerConfig.getUpdateNamesrvAddrInterval(), TimeUnit.MILLISECONDS);
} else if (this.brokerContainerConfig.isFetchNamesrvAddrByAddressServer()) {
this.scheduledExecutorService.scheduleAtFixedRate(new AbstractBrokerRunnable(BrokerIdentity.BROKER_CONTAINER_IDENTITY) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ public class BrokerContainerConfig {
*/
private long fetchNamesrvAddrInterval = 10 * 1000;

/**
* The interval to update namesrv addr, default value is 120 second
*/
private long updateNamesrvAddrInterval = 60 * 2 * 1000;

public String getRocketmqHome() {
return rocketmqHome;
}
Expand Down Expand Up @@ -95,4 +100,12 @@ public long getFetchNamesrvAddrInterval() {
public void setFetchNamesrvAddrInterval(final long fetchNamesrvAddrInterval) {
this.fetchNamesrvAddrInterval = fetchNamesrvAddrInterval;
}

public long getUpdateNamesrvAddrInterval() {
return updateNamesrvAddrInterval;
}

public void setUpdateNamesrvAddrInterval(long updateNamesrvAddrInterval) {
this.updateNamesrvAddrInterval = updateNamesrvAddrInterval;
}
}

0 comments on commit f90c553

Please sign in to comment.