Simplified code using a lambda
authorKai Moritz <kai@juplo.de>
Sun, 5 May 2024 05:44:43 +0000 (07:44 +0200)
committerKai Moritz <kai@juplo.de>
Sun, 5 May 2024 05:54:08 +0000 (07:54 +0200)
src/main/java/de/juplo/demo/kafka/deduplication/Deduplicator.java

index e1027d0..4376f30 100644 (file)
@@ -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");