X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fde%2Fjuplo%2Fkafka%2FTestRecordHandler.java;fp=src%2Ftest%2Fjava%2Fde%2Fjuplo%2Fkafka%2FTestRecordHandler.java;h=de28385438ab7a14d2f4c8120b840da7d1bcf73f;hb=b3777fba0ae679d9e2c9d36626fa208a952f83e8;hp=0000000000000000000000000000000000000000;hpb=ecd63311e0b6af698185bcf1e085f2b3237bd264;p=demos%2Fkafka%2Ftraining diff --git a/src/test/java/de/juplo/kafka/TestRecordHandler.java b/src/test/java/de/juplo/kafka/TestRecordHandler.java new file mode 100644 index 0000000..de28385 --- /dev/null +++ b/src/test/java/de/juplo/kafka/TestRecordHandler.java @@ -0,0 +1,28 @@ +package de.juplo.kafka; + +import lombok.RequiredArgsConstructor; +import org.apache.kafka.clients.consumer.ConsumerRecord; + + +@RequiredArgsConstructor +public abstract class TestRecordHandler implements RecordHandler +{ + private final RecordHandler handler; + + + public abstract void onNewRecord(ConsumerRecord record); + + + @Override + public void accept(ConsumerRecord record) + { + this.onNewRecord(record); + handler.accept(record); + } + @Override + + public void beforeNextPoll() + { + handler.beforeNextPoll(); + } +}