Package org.apache.pulsar.broker
Class ServiceConfigurationUtils
java.lang.Object
org.apache.pulsar.broker.ServiceConfigurationUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringstatic StringbrokerUrlTls(String host, int port) static StringgetAppliedAdvertisedAddress(ServiceConfiguration configuration, boolean ignoreAdvertisedListener) Deprecated.static StringgetDefaultOrConfiguredAddress(String configuredAddress) static org.apache.pulsar.policies.data.loadbalancer.AdvertisedListenergetInternalListener(ServiceConfiguration config, String protocol) Gets the internal advertised listener for broker-to-broker communication.static StringGets the web service address (hostname).static Stringstatic StringwebServiceUrl(String host, int port) static StringwebServiceUrlTls(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
-