diff --git a/pulsar-broker-common/src/main/java/com/yahoo/pulsar/broker/ServiceConfigurationUtils.java b/pulsar-broker-common/src/main/java/com/yahoo/pulsar/broker/ServiceConfigurationUtils.java index a7c0141eafe51..30ad82911efe4 100644 --- a/pulsar-broker-common/src/main/java/com/yahoo/pulsar/broker/ServiceConfigurationUtils.java +++ b/pulsar-broker-common/src/main/java/com/yahoo/pulsar/broker/ServiceConfigurationUtils.java @@ -21,12 +21,14 @@ import java.net.InetAddress; import java.net.UnknownHostException; +import static org.apache.commons.lang3.StringUtils.isBlank; + public class ServiceConfigurationUtils { private static final Logger LOG = LoggerFactory.getLogger(ServiceConfigurationUtils.class); public static String getDefaultOrConfiguredAddress(String configuredAddress) { - if ( configuredAddress == null ) { + if (isBlank(configuredAddress)) { return unsafeLocalhostResolve(); } return configuredAddress;