Skip to content

Commit

Permalink
adding a null judgement
Browse files Browse the repository at this point in the history
  • Loading branch information
weihubeats committed Aug 23, 2023
1 parent 081975a commit 381824b
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import org.apache.commons.collections.CollectionUtils;

import org.apache.commons.lang3.StringUtils;
import org.apache.rocketmq.broker.BrokerController;
import org.apache.rocketmq.broker.out.BrokerOuterAPI;
Expand Down Expand Up @@ -801,10 +801,7 @@ private void scanAvailableControllerAddresses() {

private void updateControllerAddr() {
if (brokerConfig.isFetchControllerAddrByDnsLookup()) {
List<String> addrs = brokerOuterAPI.dnsLookupAddressByDomain(this.brokerConfig.getControllerAddr());
if (CollectionUtils.isNotEmpty(addrs)) {
this.controllerAddresses = addrs;
}
this.controllerAddresses = brokerOuterAPI.dnsLookupAddressByDomain(this.brokerConfig.getControllerAddr());
} else {
final String controllerPaths = this.brokerConfig.getControllerAddr();
final String[] controllers = controllerPaths.split(";");
Expand Down

0 comments on commit 381824b

Please sign in to comment.