我正在使用spring集成來下載文件並對其進行處理。如何在使用入站通道適配器時指定輸出通道或執行順序
<int-sftp:inbound-channel-adapter channel="FileDownloadChannel"
session-factory="SftpSessionFactory"
remote-directory="/home/sshaji/from_disney/files"
filter = "modifiedFileListFilter"
local-directory="/home/sshaji/to_disney/downloads"
auto-create-local-directory="true" >
<integration:poller cron="*/10 * * * * *" default="true"/>
</int-sftp:inbound-channel-adapter>
<integration:transformer input-channel="FileDownloadChannel"
ref="ErrorTransformer"
output-channel="EndChannel"/>
執行由輪詢器啓動。 它調用「FileDownloadChannel」,然後嘗試從sftp服務器下載文件。 我想爲此入站通道適配器指定一個輸出通道,但它沒有任何輸出通道屬性。
所以我給變壓器命名的方式與入站通道適配器的命名方式相同,這樣一旦輪詢器啓動,它也會被調用。
我的問題是變壓器在下載發生之前被調用,因此變壓器不會得到任何輸入來處理並導致錯誤。
有沒有什麼辦法可以指定「order」屬性這兩個任務。或者是否有針對入站通道適配器的輸出通道的解決方法?
我真的很感謝這方面的幫助。
@GaryRussell你能爲此提出一些建議嗎? –