In a Spring Boot 2.2 application I have created a CompositeHealthIndicator
combined with a HealthAggregator
like this:
CompositeHealthIndicator healthIndicator(Map<String, HealthIndicator> healthIndicators){
var aggregator = new OrderedHealthAggregator();
aggregator.setStatusOrder(DOWN, OUT_OF_SERVICE, CUSTOM_SERVICE_UNAVAILABLE, HYSTRIX_CIRCUIT_OPEN_STATUS, UP, UNKNOWN);
return new CompositeHealthIndicator(aggregator, healthIndicators);
}
However, after upgrading to Spring Boot 2.5, both classes are gone. HealthAggregator
was replaced by StatusAggregator
and CompositeHealthIndicator
was replaced by CompositeHealthContributor
.
Unfortunately, a CompositeHealthContributor
can't be created with a StatusAggregator
like a CompositeHealthIndicator
could be created with a HealthAggregator
. There is no such constructor for it.
How can I combine CompositeHealthContributor
with StatusAggregator
?