A consumer that allows you to index document records into Elasticsearch.
The ElasticsearchConsumerConfiguration
auto-configuration provides the following bean:
Consumer<Message<?>> elasticsearchConsumer
After injecting this Consumer
bean in the application, it’s accept
method can be called programmatically to index Elasticsearch documents.
This consumer only supports indexing documents with JSON formats.
The JSON document can be provided using one of the following methods.
-
JSON string
-
java.util.Map
-
XContentBuilder
provided by Elasticsearch
All configuration properties are prefixed with elasticsearch.consumer
.
For more information on the various options available, please see ElasticsearchConsumerProperties.
In addition to these options, the consumer makes use of Spring Boot autoconfiguration for Elasticsearch. Therefore, you need to use these properties for configuration Elasticsearch. See this section from Spring Boot docs.
See this test suite for seeing the Elasticsearch consumer in action.
See this README where this consumer is used for creating an Elasticsearch sink.