【发布时间】:2016-09-19 20:54:24
【问题描述】:
在单元测试时,我尝试将 Spring Integration 默认通道桥接到排队通道,因为我想检查进入此通道的消息流量的正确性。
<int:filter input-channel="prevChannel" output-channel="myChannel">
<int:bridge input-channel="myChannel" output-channel="aggregateChannel">
// the reason I have above bridge is I want to check the amount of message after filter.
// I cannot check prevChannel since it is before filtering, and I cannot check aggregateChannel
// because it has other processing branch
// in test xml I import above normal workflow xml and added below configuration to
// redirect message from myChannel to checkMyChannel to checking.
<int:bridge input-channel="myChannel"
output-channel="checkMyChannel"/>
<int:channel id="checkMyChannel">
<int:queue/>
</int:channel>
我在单元测试中自动装配了 checkMyChannel 但 checkMyChannel.getqueuesize() 总是返回 0。
是不是我做错了什么?
【问题讨论】:
标签: spring spring-integration bridge