Further simplified the example: Removed unnecessary variables
authorKai Moritz <kai@juplo.de>
Sat, 10 Oct 2020 18:40:27 +0000 (20:40 +0200)
committerKai Moritz <kai@juplo.de>
Sun, 5 May 2024 05:49:39 +0000 (07:49 +0200)
src/main/java/de/juplo/demo/kafka/deduplication/DeduplicationTransformer.java

index dc888bc..2494672 100644 (file)
@@ -1,7 +1,6 @@
 package de.juplo.demo.kafka.deduplication;
 
 import lombok.extern.slf4j.Slf4j;
-import org.apache.kafka.common.header.Headers;
 import org.apache.kafka.streams.kstream.ValueTransformer;
 import org.apache.kafka.streams.processor.ProcessorContext;
 import org.apache.kafka.streams.state.KeyValueStore;
@@ -28,11 +27,7 @@ public class DeduplicationTransformer implements ValueTransformer<String, Iterab
   @Override
   public Iterable<String> transform(String value)
   {
-    String topic = context.topic();
     Integer partition = context.partition();
-    long offset = context.offset();
-    Headers headers = context.headers();
-
     long sequenceNumber = Long.parseLong(value);
 
     Long seen = store.get(partition);