In the last recipe, the Validator
class was coded. Now, in this recipe everything is compiled and executed.
At this point, the ProcessingApp
class coordinates the Reader
and Writer
classes. It contains the main
method to execute them. We have to edit the ProcessingApp.java
file located at src/main/java/doubloon/ProcessingApp.java
and change it with the following code:
package doubloon; import org.apache.kafka.clients.consumer.ConsumerRecord; import org.apache.kafka.clients.consumer.ConsumerRecords; public class ProcessingApp { public static void main(String[] args) { String servers = args[0]; String groupId = args[1]; String sourceTopic = args[2]; String goodTopic = args[3]; String badTopic = args[4]; Reader reader = new Reader(servers, groupId, sourceTopic); Validator validator = new Validator(servers, goodTopic...