WIP wip-integration-xml
authorKai Moritz <kai@juplo.de>
Thu, 30 Jun 2022 19:37:01 +0000 (21:37 +0200)
committerKai Moritz <kai@juplo.de>
Thu, 30 Jun 2022 19:37:01 +0000 (21:37 +0200)
src/main/java/de/juplo/kafka/wordcount/splitter/SplitterApplication.java
src/main/resources/integration.xml

index e73d2bb..37ea9a7 100644 (file)
@@ -30,14 +30,6 @@ import org.springframework.messaging.support.ChannelInterceptor;
 @ImportResource("classpath:integration.xml")
 public class SplitterApplication
 {
-       @Bean
-       MessageChannel words(ChannelInterceptor keyInterceptor)
-       {
-               DirectChannel words = new DirectChannel();
-               words.addInterceptor(keyInterceptor);
-               return words;
-       }
-
        @Bean
        ChannelInterceptor keyInterceptor ()
        {
index 4ecea8b..14bd157 100644 (file)
@@ -8,11 +8,10 @@
                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="recordings"
-      consumer-factory="kafkaConsumerFactory"
-      payload-type="java.lang.String"
-      group-id="splitter"
-      channel="recordings" />
+  <int:channel id="words">
+    <int:interceptors>
+      <ref bean="keyInterceptor"/>
+    </int:interceptors>
+  </int:channel>
 
 </beans>