Remove the need for @EnableDiscoveryClient (#245)

Enable AutoServiceRegistrationConfiguration by default.
This commit is contained in:
Ryan Baxter
2017-09-25 12:21:02 -04:00
committed by GitHub
parent 99488a163b
commit dd16ce0a31
8 changed files with 131 additions and 2 deletions

View File

@@ -317,6 +317,9 @@ Commons provides the `@EnableDiscoveryClient` annotation. This looks for impleme
By default, implementations of `DiscoveryClient` will auto-register the local Spring Boot server with the remote discovery server. This can be disabled by setting `autoRegister=false` in `@EnableDiscoveryClient`.
NOTE: The use of `@EnableDiscoveryClient` is no longer required. It is enough to just have a `DiscoveryClient` implementation
on the classpath to cause the Spring Boot application to register with the service discovery server.
==== Health Indicator
Commons creates a Spring Boot `HealthIndicator` that `DiscoveryClient` implementations can participate in by implementing `DiscoveryHealthIndicator`. To disable the composite `HealthIndicator` set `spring.cloud.discovery.client.composite-indicator.enabled=false`. A generic `HealthIndicator` based on `DiscoveryClient` is auto-configured (`DiscoveryClientHealthIndicator). To disable it, set `spring.cloud.discovery.client.health-indicator.enabled=false`. To disable the description field of the `DiscoveryClientHealthIndicator` set `spring.cloud.discovery.client.health-indicator.include-description=false`, otherwise it can bubble up as the `description` of the rolled up `HealthIndicator`.