如何手动触发ftp入站通道适配器轮询?

时间:2013-06-25 07:33:25

标签: java spring spring-integration

如果我有这样定义的ftp入站通道适配器,如何手动触发FTP轮询?

<int-ftp:inbound-channel-adapter 
    id="id" 
    channel="ftpIn" 
    session-factory="sessionFactory" 
    filename-regex="${pattern}" 
    auto-create-local-directory="true" 
    delete-remote-files="false" 
    remote-directory="${remotedir}" 
    local-directory="${localdir}" 
    auto-startup="false">

        <int:poller id="poller" cron="0 15 19 * * MON-FRI" max-messages-per-poll="4" />

    </int-ftp:inbound-channel-adapter>

1 个答案:

答案 0 :(得分:3)

如果你的意思是在它的时间表之前解雇它,那就没有办法做到这一点;您可以编写自定义触发器,允许更改计划,但更改将在下一个计划的轮询之后生效。这在Dynamic Poller Sample App中进行了探讨。

this answer中讨论了另一种技术,其中适配器具有触发一次的触发器,并且通过停止/启动适配器来控制轮询。

最后,对于“按需”ftp操作,请考虑使用Outbound GatewayFTP Sample App有一个例子。

相关问题