WIP
authorKai Moritz <kai@juplo.de>
Thu, 30 Jun 2022 14:58:08 +0000 (16:58 +0200)
committerKai Moritz <kai@juplo.de>
Thu, 30 Jun 2022 19:34:51 +0000 (21:34 +0200)
src/main/java/de/juplo/kafka/wordcount/splitter/SplitterApplication.java
src/main/resources/integration-context.xml

index d9ba135..367efa0 100644 (file)
@@ -55,15 +55,6 @@ public class SplitterApplication
                };
        }
 
-       @InboundChannelAdapter(channel = "recordings")
-       @Bean
-       KafkaMessageSource<String, String> source(
-                       ConsumerFactory<String, String> cf,
-                       SplitterApplicationProperties properties)
-       {
-               return new KafkaMessageSource<>(cf, new ConsumerProperties(properties.getInputTopic()));
-       }
-
        @Bean
        @ServiceActivator(inputChannel = "words")
        MessageHandler handler(
index 6cf3ef5..f6ec728 100644 (file)
@@ -1,6 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns="http://www.springframework.org/schema/beans"
-       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:int="http://www.springframework.org/schema/integration"
+    xmlns:int-kafka="http://www.springframework.org/schema/integration/kafka"
+    xsi:schemaLocation="
+        http://www.springframework.org/schema/beans https://www.springframework.org/schema/beans/spring-beans.xsd
+               http://www.springframework.org/schema/integration https://www.springframework.org/schema/integration/spring-integration.xsd
+        http://www.springframework.org/schema/integration/kafka http://www.springframework.org/schema/integration/kafka/spring-integration-kafka.xsd">
+
+  <int-kafka:inbound-channel-adapter id="source" consumer-factory="consumerFactory" channel="recordings"/>
 
 </beans>