In Chapter 8, Rivers, we saw how powerful the river plugins are. They allow you to populate an ElasticSearch cluster from different sources (DBMS, NoSQL system, streams, and so on). Creating a custom river is necessary if you need to do the following:
Add a new NoSQL data source that is not supported by the already existing plugins
Add a new stream type
Add a custom business logic to import data in ElasticSearch, such as field modification, data aggregation, and, in general, a data brewery
In this recipe, we will implement a simple river that generates documents with a field that contains an incremental value and ingests them in ElasticSearch.
You will need a working ElasticSearch node, a Maven build tool, and optionally a Java IDE. The code of this recipe is available in the chapter12/river_plugin
directory.