在單元測試時間,我嘗試將Spring集成默認通道橋接到排隊通道,因爲我想檢查到此通道的消息流量的正確性。春季集成橋樑直接通道到隊列通道
<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.getqueuesize()自動裝配checkMyChannel始終返回0
有沒有......我做錯了什麼?
已編輯。請檢查,謝謝 – edi
你的代碼不工作,因爲我不知道'gateway.publish()'是什麼,你沒有解釋你爲什麼需要'' –
哇!還有'aggregateChannel'。所以,對於同一個'myChannel',你有兩個'',它看起來像帶有默認循環平衡器的'DirectChannel'。所以,現在你的配置更加複雜。不確定你在這裏尋找哪種幫助,但很難幫助不合作的人...... –