From: Kai Moritz Date: Wed, 25 Sep 2024 17:13:05 +0000 (+0200) Subject: Einheitliche Benennung des Producers -- ALIGN X-Git-Tag: producer/spring-producer--Shutdown-Hängt~12 X-Git-Url: http://juplo.de/gitweb/?a=commitdiff_plain;h=fa8267ba827e7205d2de67c056a29c37203c54f9;p=demos%2Fkafka%2Ftraining Einheitliche Benennung des Producers -- ALIGN --- diff --git a/src/main/java/de/juplo/kafka/ApplicationConfiguration.java b/src/main/java/de/juplo/kafka/ApplicationConfiguration.java index 0642aa4..132413c 100644 --- a/src/main/java/de/juplo/kafka/ApplicationConfiguration.java +++ b/src/main/java/de/juplo/kafka/ApplicationConfiguration.java @@ -14,12 +14,12 @@ import java.util.Properties; public class ApplicationConfiguration { @Bean - public RestProducer restProducer( + public ExampleProducer exampleProducer( ApplicationProperties properties, KafkaProducer kafkaProducer) { return - new RestProducer( + new ExampleProducer( properties.getClientId(), properties.getTopic(), properties.getPartition(), diff --git a/src/main/java/de/juplo/kafka/ExampleProducer.java b/src/main/java/de/juplo/kafka/ExampleProducer.java index cecb980..c6e8485 100644 --- a/src/main/java/de/juplo/kafka/ExampleProducer.java +++ b/src/main/java/de/juplo/kafka/ExampleProducer.java @@ -3,7 +3,6 @@ package de.juplo.kafka; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.apache.kafka.clients.producer.Producer; -import org.apache.kafka.clients.producer.KafkaProducer; import org.apache.kafka.clients.producer.ProducerRecord; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.*; @@ -16,7 +15,7 @@ import java.math.BigInteger; @RequestMapping @ResponseBody @RequiredArgsConstructor -public class RestProducer +public class ExampleProducer { private final String id; private final String topic;