【发布时间】:2017-10-16 20:12:51
【问题描述】:
我正在尝试将消息从 int-file:inbound-channel-adapter 发送到 int-ftp:outbound-channel-adapter 以将文件移动到远程目录和 int-ftp:outbound-gateway 以删除远程目录中的文件。
现在 int-file:inbound-channel-adapter 轮询并向 int-ftp:outbound-channel-adapter 发送消息,并在第二次轮询时向 int-ftp:outbound-gateway 发送消息。
通过使用 int:splitter,我仍然能够接收单个文件的单个消息,并且只有一个通道被调用。我想将每条投票消息发送到两个频道。
示例如下:
现在工作:
- 首次轮询将消息发送到 int-ftp:outbound-channel-adapter
- 第二次轮询将消息发送到 int-ftp:outbound-gateway
- 第三次轮询将消息发送到 int-ftp:outbound-channel-adapter
- 第四次轮询将消息发送到 int-ftp:outbound-gateway
想要达到的目标:
1.First time polls 向 int-ftp:outbound-channel-adapter 和 int-ftp:outbound-gateway 发送消息 2.Second time polls 向 int-ftp:outbound-channel-adapter 和 int-ftp:outbound-gateway 发送消息
提前致谢
<int-file:inbound-channel-adapter id="inErrorINPRm"
channel="errorRm"
directory="in/error"
>
<int:poller fixed-rate="5000" />
</int-file:inbound-channel-adapter>
<int:channel id="errorRm"></int:channel>
<int:channel id="ErrorRmMv"></int:channel>
<int:channel id="ftpINPfromError"></int:channel>
<int:splitter id="splitter" input-channel="errorRm" output-channel="ErrorRmMv"/>
<int-ftp:outbound-channel-adapter id="ftpError"
channel="ErrorRmMv"
session-factory="ClientFactory"
auto-create-directory="true"
remote-directory="in/error"
>
</int-ftp:outbound-channel-adapter>
<int:header-enricher id="header-enricher-error" input-channel="ErrorRmMv" output-channel="ftpINPfromError">
<int:header name="file_remoteDirectory" value="in/working"/>
</int:header-enricher>
<int-ftp:outbound-gateway id="gatewayRmfromError"
session-factory="ClientFactory"
expression="file_remoteDirectory"
request-channel="ftpINPfromError"
command="rm"
>
</int-ftp:outbound-gateway>
【问题讨论】: