Skip to content

Commit 562627f

Browse files
committed
Deprecate auto-configuration for RestHighLevelClient
Closes gh-28598
1 parent 4e05438 commit 562627f

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/elasticsearch/ElasticsearchRestHealthIndicator.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,14 @@ public class ElasticsearchRestHealthIndicator extends AbstractHealthIndicator {
4949

5050
private final JsonParser jsonParser;
5151

52-
@SuppressWarnings("deprecation")
52+
/**
53+
* Create a new {@code ElasticsearchRestHealthIndicator} using the {@link RestClient}
54+
* obtained from the given high-level client.
55+
* @param client the high-level client
56+
* @deprecated since 2.7.0 for removal in 2.9.0 in favor of
57+
* {@link #ElasticsearchRestHealthIndicator(RestClient)}
58+
*/
59+
@Deprecated
5360
public ElasticsearchRestHealthIndicator(org.elasticsearch.client.RestHighLevelClient client) {
5461
this(client.getLowLevelClient());
5562
}

spring-boot-project/spring-boot-docs/src/docs/asciidoc/data/nosql.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,8 @@ You can use `spring.elasticsearch.*` properties to further tune how the clients
270270
[[data.nosql.elasticsearch.connecting-using-rest.restclient]]
271271
===== Connecting to Elasticsearch using RestClient
272272
If you have `elasticsearch-rest-client` on the classpath, Spring Boot will auto-configure and register a `RestClient` bean.
273-
If you have `elasticsearch-rest-high-level-client` on the classpath a `RestHighLevelClient` bean will be registered as well.
273+
If you have `elasticsearch-rest-high-level-client` on the classpath a `RestHighLevelClient` bean will be auto-configured as well.
274+
Following Elasticsearch's deprecation of `RestHighLevelClient`, its auto-configuration is deprecated and will be removed in a future release.
274275
In addition to the properties described previously, to fine-tune the `RestClient` and `RestHighLevelClient`, you can register an arbitrary number of beans that implement `RestClientBuilderCustomizer` for more advanced customizations.
275276
To take full control over the clients' configuration, define a `RestClientBuilder` bean.
276277

0 commit comments

Comments
 (0)