【发布时间】:2019-03-20 22:18:47
【问题描述】:
这是I need current easy to follow instructions for configuring spring integration kafka from XML的后续问题
Spring-integration-kafka 在过去的几次迭代中发展了很多,许多旧示例不再起作用。
特别是,这个从 spring-batch 世界桥接到 spring 集成世界的 bean 不会实例化,因为 KafkaTemplate 类没有实现 MessagingTemplate 。目前推荐的完成这种集成的方法是什么?
<bean id="partitionHandler" class="org.springframework.batch.integration.partition.MessageChannelPartitionHandler">
<property name="stepName" value="fm-step0002.messager"/>
<property name="gridSize" value="3"/>
<property name="messagingOperations" ref="kafkaTemplate"/>
</bean>
这是我的 POM 中的一个片段,显示了我正在使用的库的版本:
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-core</artifactId>
<version>5.1.3.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-kafka</artifactId>
<version>3.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-file</artifactId>
<version>5.1.2.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-core</artifactId>
<version>4.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-infrastructure</artifactId>
<version>4.1.1.RELEASE</version>
</dependency>
<dependency>
<groupId>org.springframework.batch</groupId>
<artifactId>spring-batch-integration</artifactId>
<version>4.1.1.RELEASE</version>
</dependency>
【问题讨论】:
标签: spring spring-integration spring-batch