X-Git-Url: https://juplo.de/gitweb/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fde%2Fjuplo%2Fkafka%2FApplication.java;h=2f6e4f2db57c9c0d587f7c1f5185a6b606f5d7d2;hb=ccf11628d5a1524d4bffe2f1b21b51ad713f1a67;hp=dd4b20a02dd4d8eae5160b49e476817ca80874e7;hpb=ecd5cb8483c199e0d50507a967ddcd31cd8b2aa1;p=demos%2Fkafka%2Ftraining diff --git a/src/main/java/de/juplo/kafka/Application.java b/src/main/java/de/juplo/kafka/Application.java index dd4b20a..2f6e4f2 100644 --- a/src/main/java/de/juplo/kafka/Application.java +++ b/src/main/java/de/juplo/kafka/Application.java @@ -5,7 +5,6 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; -import org.springframework.util.Assert; import java.util.concurrent.Executors; @@ -19,16 +18,12 @@ public class Application @Bean - public EndlessConsumer consumer() + public EndlessConsumer consumer(PartitionStatisticsRepository repository) { - Assert.hasText(properties.getBootstrapServer(), "consumer.bootstrap-server must be set"); - Assert.hasText(properties.getGroupId(), "consumer.group-id must be set"); - Assert.hasText(properties.getClientId(), "consumer.client-id must be set"); - Assert.hasText(properties.getTopic(), "consumer.topic must be set"); - EndlessConsumer consumer = new EndlessConsumer( Executors.newFixedThreadPool(1), + repository, properties.getBootstrapServer(), properties.getGroupId(), properties.getClientId(),