Skip to content

Commit

Permalink
[ISSUE apache#8609] Add the BrokerConfig updateNameServerAddrPeriod (a…
Browse files Browse the repository at this point in the history
  • Loading branch information
qianye1001 authored Sep 4, 2024
1 parent 632943e commit 5d43e7d
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 @@ -747,7 +747,7 @@ public void run() {
LOG.error("Failed to update nameServer address list", e);
}
}
}, 1000 * 10, 1000 * 60 * 2, TimeUnit.MILLISECONDS);
}, 1000 * 10, this.brokerConfig.getUpdateNameServerAddrPeriod(), TimeUnit.MILLISECONDS);
} else if (this.brokerConfig.isFetchNamesrvAddrByAddressServer()) {
this.scheduledExecutorService.scheduleAtFixedRate(new Runnable() {

Expand Down
13 changes: 13 additions & 0 deletions common/src/main/java/org/apache/rocketmq/common/BrokerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@ public class BrokerConfig extends BrokerIdentity {
*/
private int registerNameServerPeriod = 1000 * 30;

/**
* This configurable item defines interval of update name server address. Default: 120 * 1000 milliseconds
*/
private int updateNameServerAddrPeriod = 1000 * 120;

/**
* the interval to send heartbeat to name server for liveness detection.
*/
Expand Down Expand Up @@ -1837,4 +1842,12 @@ public boolean isSkipWhenCKRePutReachMaxTimes() {
public void setSkipWhenCKRePutReachMaxTimes(boolean skipWhenCKRePutReachMaxTimes) {
this.skipWhenCKRePutReachMaxTimes = skipWhenCKRePutReachMaxTimes;
}

public int getUpdateNameServerAddrPeriod() {
return updateNameServerAddrPeriod;
}

public void setUpdateNameServerAddrPeriod(int updateNameServerAddrPeriod) {
this.updateNameServerAddrPeriod = updateNameServerAddrPeriod;
}
}

0 comments on commit 5d43e7d

Please sign in to comment.