From: Kai Moritz Date: Wed, 5 Jun 2024 21:02:25 +0000 (+0200) Subject: recorder: 1.2.0 - Fixed implementation (``User`` was not used!) X-Git-Tag: recorder-1.2.0~1 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=b7f213ea3c41e9842e9b500ea00b49ca76ba0c90;p=demos%2Fkafka%2Fwordcount recorder: 1.2.0 - Fixed implementation (``User`` was not used!) * The introduced domain-class `User` was not used for serialization. * _Note:_ The test-case did *not* revealed this! --- diff --git a/src/main/java/de/juplo/kafka/wordcount/recorder/RecorderApplication.java b/src/main/java/de/juplo/kafka/wordcount/recorder/RecorderApplication.java index 6702a70..699c671 100644 --- a/src/main/java/de/juplo/kafka/wordcount/recorder/RecorderApplication.java +++ b/src/main/java/de/juplo/kafka/wordcount/recorder/RecorderApplication.java @@ -17,7 +17,7 @@ import java.util.Properties; public class RecorderApplication { @Bean(destroyMethod = "close") - KafkaProducer producer(RecorderApplicationProperties properties) + KafkaProducer producer(RecorderApplicationProperties properties) { Assert.hasText(properties.getBootstrapServer(), "juplo.wordcount.recorder.bootstrap-server must be set"); diff --git a/src/main/java/de/juplo/kafka/wordcount/recorder/RecorderController.java b/src/main/java/de/juplo/kafka/wordcount/recorder/RecorderController.java index c9d2109..8df5242 100644 --- a/src/main/java/de/juplo/kafka/wordcount/recorder/RecorderController.java +++ b/src/main/java/de/juplo/kafka/wordcount/recorder/RecorderController.java @@ -18,12 +18,12 @@ import jakarta.validation.constraints.NotEmpty; public class RecorderController { private final String topic; - private final KafkaProducer producer; + private final KafkaProducer producer; public RecorderController( RecorderApplicationProperties properties, - KafkaProducer producer) + KafkaProducer producer) { this.topic = properties.getTopic(); this.producer = producer; @@ -46,9 +46,9 @@ public class RecorderController { DeferredResult> result = new DeferredResult<>(); - ProducerRecord record = new ProducerRecord<>( + ProducerRecord record = new ProducerRecord<>( topic, - username, + User.of(username), Recording.of(username, sentence)); producer.send(record, (metadata, exception) ->