Add support for Elasticsearch sniffer

Closes gh-24174
This commit is contained in:
Stephane Nicoll
2020-12-23 17:11:40 +01:00
parent 1e8d5c37ed
commit 1fd17cf641
6 changed files with 309 additions and 149 deletions

View File

@@ -4983,6 +4983,19 @@ To take full control over the registration, define a `RestClientBuilder` bean.
TIP: If your application needs access to a "Low Level" `RestClient`, you can get it by calling `client.getLowLevelClient()` on the auto-configured `RestHighLevelClient`.
Additionally, if `elasticsearch-rest-client-sniffer` is on the classpath, a `Sniffer` is auto-configured to automatically discover nodes from a running Elasticsearch cluster and set them to the `RestHighLevelClient` bean.
You can further tune how `Sniffer` is configured, as shown in the following example:
[source,yaml,indent=0,configprops,configblocks]
----
spring:
elasticsearch:
rest:
sniffer:
interval: 10m
delay-after-failure: 30s
----
[[boot-features-connecting-to-elasticsearch-reactive-rest]]