Package org.apache.pulsar.broker
Class ServiceConfigurationUtils
java.lang.Object
org.apache.pulsar.broker.ServiceConfigurationUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
static String
brokerUrlTls
(String host, int port) static String
getAppliedAdvertisedAddress
(ServiceConfiguration configuration, boolean ignoreAdvertisedListener) Deprecated.static String
getDefaultOrConfiguredAddress
(String configuredAddress) static org.apache.pulsar.policies.data.loadbalancer.AdvertisedListener
getInternalListener
(ServiceConfiguration config, String protocol) Gets the internal advertised listener for broker-to-broker communication.static String
Gets the web service address (hostname).static String
static String
webServiceUrl
(String host, int port) static String
webServiceUrlTls
(String host, int port)
-
Constructor Details
-
ServiceConfigurationUtils
public ServiceConfigurationUtils()
-
-
Method Details
-
getDefaultOrConfiguredAddress
-
unsafeLocalhostResolve
-
getAppliedAdvertisedAddress
@Deprecated public static String getAppliedAdvertisedAddress(ServiceConfiguration configuration, boolean ignoreAdvertisedListener) Deprecated.Get the address of Broker, first try to get it from AdvertisedAddress. If it is not set, try to get the address set by advertisedListener. If it is still not set, get it through InetAddress.getLocalHost().- Parameters:
configuration
-ignoreAdvertisedListener
- Sometimes we can’t use the default key of AdvertisedListener, setting it to true can ignore AdvertisedListener.- Returns:
-
getInternalListener
public static org.apache.pulsar.policies.data.loadbalancer.AdvertisedListener getInternalListener(ServiceConfiguration config, String protocol) Gets the internal advertised listener for broker-to-broker communication.- Returns:
- a non-null advertised listener
-
getWebServiceAddress
Gets the web service address (hostname). -
brokerUrl
-
brokerUrlTls
-
webServiceUrl
-
webServiceUrlTls
-