From 04922a0d614909e58cb2fd6d3498dcacd84fdea7 Mon Sep 17 00:00:00 2001 From: Kai Moritz Date: Sun, 17 Jul 2022 18:05:37 +0200 Subject: [PATCH] WIP --- .../kafka/wordcount/splitter/SplitterApplication.java | 11 +++++++++++ src/main/resources/integration.xml | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/juplo/kafka/wordcount/splitter/SplitterApplication.java b/src/main/java/de/juplo/kafka/wordcount/splitter/SplitterApplication.java index 22576a0..94dc1c8 100644 --- a/src/main/java/de/juplo/kafka/wordcount/splitter/SplitterApplication.java +++ b/src/main/java/de/juplo/kafka/wordcount/splitter/SplitterApplication.java @@ -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 source( diff --git a/src/main/resources/integration.xml b/src/main/resources/integration.xml index 13d2f87..c67cccf 100644 --- a/src/main/resources/integration.xml +++ b/src/main/resources/integration.xml @@ -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']" /> -- 2.20.1