WIP
authorKai Moritz <kai@juplo.de>
Sun, 17 Jul 2022 16:05:37 +0000 (18:05 +0200)
committerKai Moritz <kai@juplo.de>
Sun, 17 Jul 2022 16:05:37 +0000 (18:05 +0200)
src/main/java/de/juplo/kafka/wordcount/splitter/SplitterApplication.java
src/main/resources/integration.xml

index 22576a0..94dc1c8 100644 (file)
@@ -1,5 +1,6 @@
 package de.juplo.kafka.wordcount.splitter;
 
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
 import org.springframework.boot.context.properties.EnableConfigurationProperties;
@@ -18,6 +19,16 @@ import org.springframework.kafka.listener.ConsumerProperties;
 @ImportResource("classpath:integration.xml")
 public class SplitterApplication
 {
+       @Autowired
+       SplitterApplicationProperties properties;
+
+
+       @Bean
+       SplitterApplicationProperties properties()
+       {
+               return properties;
+       }
+
        @InboundChannelAdapter(channel = "recordings")
        @Bean
        KafkaMessageSource<String, String> source(
index 13d2f87..c67cccf 100644 (file)
@@ -14,7 +14,7 @@
       id="foo"
       channel="words"
       kafka-template="kafkaTemplate"
-      topic-expression="${juplo.wordcount.splitter.output-topic}?:'BOOM'"
+      topic-expression="#properties.getOutputTopic()"
       message-key-expression="headers['kafka_receivedMessageKey']" />
 
 </beans>