#509 - Favor Spring Boot auto-configuration in Elasticsearch example.

This commit is contained in:
Mark Paluch
2020-06-16 15:16:29 +02:00
parent 3d88c50655
commit d92e7feabc
11 changed files with 37 additions and 75 deletions

View File

@@ -1,19 +1,13 @@
# Spring Data Elasticsearch - Reactive Examples
The `ReactiveElasticsearchClient` is a non official driver based on `WebClient`.
The `ReactiveElasticsearchClient` is a client based on `WebClient`.
It uses the request/response objects provided by the Elasticsearch core project.
Calls are directly operated on the reactive stack, not wrapping async (thread pool bound) responses into reactive types.
````java
class ApplicationConfiguration extends AbstractReactiveElasticsearchConfiguration {
@Bean
@Override
public ReactiveElasticsearchClient reactiveElasticsearchClient() {
return ReactiveRestClients.create(ClientConfiguration.localhost());
}
}
````
```java
@SpringBootApplication
class ApplicationConfiguration {}
```
The `ReactiveElasticsearchClient` can be used with the `ReactiveElasticsearchOperations` and `ReactiveElasticsearchRepository`.