关于Spring-Integration的介绍这里不需要赘述,现在我们需要实现的是发送一个param,里面有两个参数dataType和data,dataType是0和1除外的舍弃,剩余dataType=0的数据往oldChannel通道发,剩余dataType=1的数据往newChannel通道发,消费数据并且打印
1,配置文件 : application.xml
<beans:beans
xmlns="http://www.springframework.org/schema/integration"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/integration
http://www.springframework.org/schema/integration/spring-integration.xsd">
<!-- 要输入的信息往这个通道里塞即可 -->
<channel id="inputChannel" />
<!-- 这个过滤器可以过滤一些非法信息,重组消息体等 -->
<splitter input-channel="inputChannel" ref="splitService" output-channel="afterSplitChannel" />
<!-- 路由转发,重新转发到另外的通道去 getDist