Java PlainStreamsProcessor

Now, in the src/main/java/kioto/plain directory, create a file called 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:

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 O’Reilly online learning.

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