i had add "eureka.client.healthcheck.enabled: true" to my application.properties on client side.
Just need this configuration right ?Anything else?
@Bean
@ConditionalOnMissingBean
public EurekaHealthCheckHandler eurekaHealthCheckHandler() {
return new EurekaHealthCheckHandler(new EurekaRemoteStatusExcludedHealthAggregator());
}
public class EurekaRemoteStatusExcludedHealthAggregator extends OrderedHealthAggregator {
private int count = 1;
public EurekaRemoteStatusExcludedHealthAggregator() {
System.out.println("####################################hello health checking is start");
}
@Override
protected Status aggregateStatus(List<Status> candidates) {
System.out.println("####################################hello health checking is starting......" + count++ +
new Date());
List<Status> candidatesWithoutEurekaRemoteStatus = candidates.stream()
.filter(candidate -> !isEurekaRemoteStatusCandidate(candidate))
.collect(Collectors.toList());
return super.aggregateStatus(candidatesWithoutEurekaRemoteStatus);
}
private boolean isEurekaRemoteStatusCandidate(Status candidate)
{
return candidate.getDescription().equalsIgnoreCase("Remote status from Eureka server");
}