Java PlainStreamsProcessor

Now, in the src/main/java/kioto/plain directory, create a file called PlainStreamsProcessor.java with the contents of Listing 6.2, shown as follows:

import ...public final class PlainStreamsProcessor {  private final String brokers;  public PlainStreamsProcessor(String brokers) {    super();    this.brokers = brokers;  }  public final void process() {    // below we will see the contents of this method   }  public static void main(String[] args) {    (new PlainStreamsProcessor("localhost:9092")).process();  }}
Listing 6.2: PlainStreamsProcessor.java

All the magic happens inside the process() method. The first step in a Kafka Streams application is to get a StreamsBuilder instance, as shown in the following code:

StreamsBuilder streamsBuilder ...

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.