Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE #7497] Extract the frequency of calling updateNamesrvAddr into a configuration #7498

Merged
merged 1 commit into from
Oct 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
}
}