spring-cloud-netflix: Problem with EurekaHealthCheckHandler configuration in 1.1.2.RELEASE
I’m testing Spring Cloud Brixton.SR1 that uses Spring Cloud Netflix 1.1.2.RELEASE. I found that EurekaHealthCheckHandlerConfiguration
register EurekaHealthCheckHandler
probably to early. In my environmet this code returns empty list:
public class EurekaHealthCheckHandler {
...
@Override
public void afterPropertiesSet() throws Exception {
final Map<String, HealthIndicator> healthIndicators = applicationContext.getBeansOfType(HealthIndicator.class);
In old version it works fine. Probably configuration is done too early because in 1.1.2 there is no dependency to HealthIndicator
class:
@Configuration
@ConditionalOnProperty(value = "eureka.client.healthcheck.enabled", matchIfMissing = false)
@ConditionalOnBean(HealthIndicator.class) // this has been removed in 1.1.2.
protected static class EurekaHealthCheckHandlerConfiguration {
...
}
It is strange but I get this error only when using DiscoveryClient
to locate the Config Server.
Second strange behavior is that only when DiscoveryClient
is enabled, service is sending health checks (eureka.client.healthcheck.enabled=true
) to Eureka but always with status UNKNOWN (as a consequence of problem in EurekaHealthCheckHandler.afterPropertiesSet()
).
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 17 (13 by maintainers)
Please post something here if you can in the future and we can reopen
@ryanjbaxter This is not so easy. We built set of parent poms on the top of Spring Cloud. Update is always painful. I will try to check this next week.
@spencergibb The feature “spring.cloud.config.discovery.enabled=true” in Dalston still does not work. How to fix workaround this?? There is documentation (http://cloud.spring.io/spring-cloud-static/Dalston.SR3/#discovery-first-bootstrap), but the feature simply does not work and is not fixed ? Why?
This change introduced the Bug! https://github.com/spring-cloud/spring-cloud-netflix/commit/6b1113e355dd15a24f269dc96618c55d3faaa1cf