java.lang.Object
de.codecentric.boot.admin.server.cloud.discovery.DefaultServiceInstanceConverter
All Implemented Interfaces:
ServiceInstanceConverter
Direct Known Subclasses:
EurekaServiceInstanceConverter, KubernetesServiceInstanceConverter

public class DefaultServiceInstanceConverter extends Object implements ServiceInstanceConverter
Converts any ServiceInstances to Instances. To customize the health- or management-url for all instances you can set healthEndpointPath or managementContextPath respectively. If you want to influence the url per service you can add management.scheme, management.address, management.port, management.context-path or health.path to the instances metadata.
Author:
Johannes Edmeier
  • Constructor Details

    • DefaultServiceInstanceConverter

      public DefaultServiceInstanceConverter()
  • Method Details

    • getMetadataValue

      @Nullable protected static String getMetadataValue(org.springframework.cloud.client.ServiceInstance instance, String... keys)
    • convert

      public Registration convert(org.springframework.cloud.client.ServiceInstance instance)
      Description copied from interface: ServiceInstanceConverter
      Converts a service instance to a application instance to be registered.
      Specified by:
      convert in interface ServiceInstanceConverter
      Parameters:
      instance - the service instance.
      Returns:
      the Registration
    • getHealthUrl

      protected URI getHealthUrl(org.springframework.cloud.client.ServiceInstance instance)
    • getHealthPath

      protected String getHealthPath(org.springframework.cloud.client.ServiceInstance instance)
    • getManagementUrl

      protected URI getManagementUrl(org.springframework.cloud.client.ServiceInstance instance)
    • getManagementHost

      protected String getManagementHost(org.springframework.cloud.client.ServiceInstance instance)
    • getManagementPort

      protected int getManagementPort(org.springframework.cloud.client.ServiceInstance instance)
    • getManagementPath

      protected String getManagementPath(org.springframework.cloud.client.ServiceInstance instance)
    • getServiceUrl

      protected URI getServiceUrl(org.springframework.cloud.client.ServiceInstance instance)
    • getMetadata

      protected Map<String,String> getMetadata(org.springframework.cloud.client.ServiceInstance instance)
    • getManagementContextPath

      public String getManagementContextPath()
    • setManagementContextPath

      public void setManagementContextPath(String managementContextPath)
    • getHealthEndpointPath

      public String getHealthEndpointPath()
    • setHealthEndpointPath

      public void setHealthEndpointPath(String healthEndpointPath)