Java PlainProcessor

Now, in the src/main/java/kioto/plain directory, create a file called PlainProcessor.java with the content of Listing 4.9.

The following is the content of Listing 4.9PlainProcessor.java (part 1):

package kioto.plain;import ...public final class PlainProcessor {  private Consumer<String, String> consumer;  private Producer<String, String> producer;  public PlainProcessor(String brokers) {    Properties consumerProps = new Properties();    consumerProps.put("bootstrap.servers", brokers);    consumerProps.put("group.id", "healthcheck-processor");    consumerProps.put("key.deserializer", StringDeserializer.class);    consumerProps.put("value.deserializer", StringDeserializer.class);    consumer = new KafkaConsumer<>(consumerProps); Properties ...

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.