Class ServiceConfigurationUtils

java.lang.Object
org.apache.pulsar.broker.ServiceConfigurationUtils

public class ServiceConfigurationUtils extends Object
  • Constructor Details

    • ServiceConfigurationUtils

      public ServiceConfigurationUtils()
  • Method Details

    • getDefaultOrConfiguredAddress

      public static String getDefaultOrConfiguredAddress(String configuredAddress)
    • unsafeLocalhostResolve

      public static String 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

      public static String getWebServiceAddress(ServiceConfiguration config)
      Gets the web service address (hostname).
    • brokerUrl

      public static String brokerUrl(String host, int port)
    • brokerUrlTls

      public static String brokerUrlTls(String host, int port)
    • webServiceUrl

      public static String webServiceUrl(String host, int port)
    • webServiceUrlTls

      public static String webServiceUrlTls(String host, int port)