Writing code

The Elasticsearch setup and configuration has been described in Chapter 3Understanding and Tailing Data Streams, under DIY section. Apart from the configuration mentioned there, change the given property in elasticsearch.yml:

cluster.name: my-application 

We learned how to write topology code in previous sections. Now, we will discuss the Elasticsearch bolt that reads the data from other bolts/spouts and writes into Elasticsearch. Perform the following steps:

  1. Add the following dependencies in pom.xml:
<!-- Need for JSON parsing --> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>2.8.7</version> </dependency> <!-- Need for Elasticsearch java client API --> <dependency> ...

Get Practical Real-time Data Processing and Analytics now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.