Running the engine

Now that the final version of the Enricher class is coded, we have to compile and execute it.

As we know, the ProcessingEngine class contains the main method to coordinate the reader and writer classes. Now, let's modify the ProcessingEngine.java file on the src/main/java/monedero/ directory and replace Validator with Enricher as in the highlighted code in Listing 3.6:

package monedero;public class ProcessingEngine {  public static void main(String[] args){    String servers = args[0];    String groupId = args[1];    String sourceTopic = args[2];    String validTopic = args[3];    String invalidTopic = args[4];    Reader reader = new Reader(servers, groupId, sourceTopic); Enricher enricher = new Enricher(servers, validTopic, invalidTopic); ...

Get Apache Kafka Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.