Now, in the src/main/java/kioto/custom directory, create a file called CustomProcessor.java with the content of Listing 4.16.
The following is the content of Listing 4.16, CustomProcessor.java (part 1):
package kioto.custom;
import ...
public final class CustomProcessor {
private Consumer<String, HealthCheck> consumer;
private Producer<String, String> producer;
public CustomProcessor(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", HealthCheckDeserializer.class);
consumer = new KafkaConsumer<>(consumerProps);
Properties producerProps...