@ImportResource("classpath:integration.xml")
public class SplitterApplication
{
- @Bean
- MessageChannel words(ChannelInterceptor keyInterceptor)
- {
- DirectChannel words = new DirectChannel();
- words.addInterceptor(keyInterceptor);
- return words;
- }
-
@Bean
ChannelInterceptor keyInterceptor ()
{
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>