Prepared for development ov version `1.0.2`
[demos/kafka/deduplication] / src / main / java / de / juplo / demo / kafka / deduplication / Deduplicator.java
index 38ec22a..4376f30 100644 (file)
@@ -1,6 +1,8 @@
 package de.juplo.demo.kafka.deduplication;
 
 
+import jakarta.annotation.PostConstruct;
+import jakarta.annotation.PreDestroy;
 import org.apache.kafka.common.serialization.IntegerSerializer;
 import org.apache.kafka.common.serialization.Serdes;
 import org.apache.kafka.streams.*;
@@ -18,8 +20,6 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PathVariable;
 import org.springframework.web.bind.annotation.RestController;
 
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
 import java.time.Duration;
 import java.util.Properties;
 
@@ -79,14 +79,7 @@ public class Deduplicator
     builder
         .<String, String>stream("input")
         .flatTransformValues(
-            new ValueTransformerSupplier<String, Iterable<String>>()
-            {
-              @Override
-              public ValueTransformer<String, Iterable<String>> get()
-              {
-                return new DeduplicationTransformer();
-              }
-            },
+            () -> new DeduplicationTransformer(),
             DeduplicationTransformer.STORE)
         .to("output");