public class DefaultServiceInstanceConverter extends Object implements ServiceInstanceConverter
ServiceInstances to Applications. To customize the health- or
management-url for all applications you can set healthEndpointPath or managementContextPath
respectively. If you want to influence the url per service you can add
management.context-path or management.port or health.path
to the instances metadata.| Constructor and Description |
|---|
DefaultServiceInstanceConverter() |
| Modifier and Type | Method and Description |
|---|---|
Application |
convert(org.springframework.cloud.client.ServiceInstance instance)
Converts a service instance to a application to be registered.
|
protected URI |
getHealthUrl(org.springframework.cloud.client.ServiceInstance instance) |
protected URI |
getManagementUrl(org.springframework.cloud.client.ServiceInstance instance) |
protected URI |
getServiceUrl(org.springframework.cloud.client.ServiceInstance instance) |
void |
setHealthEndpointPath(String healthEndpointPath)
Default path of the health-endpoint to be used for the health-url of the discovered service.
|
void |
setManagementContextPath(String managementContextPath)
Default
management.context-path to be appended to the url of the discovered
service for the managment-url. |
public Application convert(org.springframework.cloud.client.ServiceInstance instance)
ServiceInstanceConverterconvert in interface ServiceInstanceConverterinstance - the service instance.protected URI getHealthUrl(org.springframework.cloud.client.ServiceInstance instance)
protected URI getManagementUrl(org.springframework.cloud.client.ServiceInstance instance)
protected URI getServiceUrl(org.springframework.cloud.client.ServiceInstance instance)
public void setManagementContextPath(String managementContextPath)
management.context-path to be appended to the url of the discovered
service for the managment-url.managementContextPath - the management context-path.public void setHealthEndpointPath(String healthEndpointPath)
healthEndpointPath - the path for the health-endpoint.Copyright © 2016 codecentric AG. All rights reserved.