Skip to content

Latest commit

 

History

History
35 lines (21 loc) · 1.83 KB

File metadata and controls

35 lines (21 loc) · 1.83 KB

Elasticsearch Consumer

A consumer that allows you to index document records into Elasticsearch.

Beans for injection

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

Configuration Options

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.

Examples

See this test suite for seeing the Elasticsearch consumer in action.

Other usage

See this README where this consumer is used for creating an Elasticsearch sink.