Mikhail Geyer
Mikhail Geyer

Reputation: 1171

SpringBoot does not contain ElasticSearchRestHealthIndicatorAutoConfiguration anymore

My app has Elasticsearch health check disabled like this:

import org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticSearchRestHealthIndicatorAutoConfiguration;


@SpringBootApplication(exclude = {        
    ElasticSearchRestHealthIndicatorAutoConfiguration.class
})
public class MyApp

It works fine with SpringBoot 2.1.8.RELEASE. But now I want to upgrade my app to SpringBoot 2.2.2.RELEASE. The problem is that SpringBoot 2.2.2.RELEASE does not contain ElasticSearchRestHealthIndicatorAutoConfiguration class anymore.

How this situation can be handled? What should be used in SpringBoot 2.2.2.RELEASE instead of ElasticSearchRestHealthIndicatorAutoConfiguration to turn Elasticsearch health check off?

Upvotes: 0

Views: 863

Answers (1)

Mikhail Geyer
Mikhail Geyer

Reputation: 1171

It seems that starting from 2.2.0.RELEASE we need to use ElasticSearchRestHealthContributorAutoConfiguration instead of ElasticSearchRestHealthIndicatorAutoConfiguration class.

As written in the doc those classes are the auto-configuration for ElasticsearchRestHealthIndicator using the RestClient.

The rest remains the same

import org.springframework.boot.actuate.autoconfigure.elasticsearch.ElasticSearchRestHealthContributorAutoConfiguration;

@SpringBootApplication(exclude = {ElasticSearchRestHealthContributorAutoConfiguration.class})
public class MyApp

Upvotes: 2

Related Questions