From 5ff71b5fee6186b5ca0ca874f370969372639fd1 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Wed, 25 Sep 2024 18:19:41 +0200 Subject: [PATCH] Einheitliche Benennung des Producers -- ALIGN --- src/main/java/de/juplo/kafka/Application.java | 6 +++--- src/main/java/de/juplo/kafka/DriverController.java | 2 +- src/main/java/de/juplo/kafka/ExampleProducer.java | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/de/juplo/kafka/Application.java b/src/main/java/de/juplo/kafka/Application.java index 0719459..e2d3e87 100644 --- a/src/main/java/de/juplo/kafka/Application.java +++ b/src/main/java/de/juplo/kafka/Application.java @@ -16,14 +16,14 @@ import java.util.concurrent.Executors; public class Application { @Bean - public EndlessProducer producer( + public ExampleProducer producer( ApplicationProperties properties, @Value("${spring.kafka.client-id:DEV}") String clientId, KafkaTemplate kafkaTemplate) { - EndlessProducer producer = - new EndlessProducer( + ExampleProducer producer = + new ExampleProducer( Executors.newFixedThreadPool(1), clientId, properties.getThrottleMs(), diff --git a/src/main/java/de/juplo/kafka/DriverController.java b/src/main/java/de/juplo/kafka/DriverController.java index ce4df68..ab90e3c 100644 --- a/src/main/java/de/juplo/kafka/DriverController.java +++ b/src/main/java/de/juplo/kafka/DriverController.java @@ -14,7 +14,7 @@ import java.util.concurrent.ExecutionException; @RequiredArgsConstructor public class DriverController { - private final EndlessProducer producer; + private final ExampleProducer producer; @PostMapping("start") diff --git a/src/main/java/de/juplo/kafka/ExampleProducer.java b/src/main/java/de/juplo/kafka/ExampleProducer.java index 30fefab..b435a08 100644 --- a/src/main/java/de/juplo/kafka/ExampleProducer.java +++ b/src/main/java/de/juplo/kafka/ExampleProducer.java @@ -13,7 +13,7 @@ import java.util.concurrent.ExecutorService; @Slf4j -public class EndlessProducer implements Runnable +public class ExampleProducer implements Runnable { private final ExecutorService executor; private final String id; @@ -24,7 +24,7 @@ public class EndlessProducer implements Runnable private long i = 0; private long produced = 0; - public EndlessProducer( + public ExampleProducer( ExecutorService executor, String clientId, int throttleMs, -- 2.20.1