如何将服务激活器连接到sftp:inbound-channel-adapter

时间:2016-01-05 14:50:59

标签: spring-integration sftp

案例:我想从SMTP服务器获取一个文件到本地,我想在文件下载到本地后进行后期处理。 我想在下载每个文件后做一个业务逻辑(比如上传到aws s3)。每当文件下载到本地时我都想调用messageHandler.handleSftp()。有什么建议吗?

<int-sftp:inbound-channel-adapter id="sftpInbondAdapter"
    auto-startup="true" channel="receiveChannel"

    session-factory="sftpSessionFactory"
    local-directory="file:/fluentbatch/sftp" remote-directory="/tmp/datlaa"
    auto-create-local-directory="true" delete-remote-files="false"
    filename-pattern="*.txt">
    <int:poller fixed-rate="1000" max-messages-per-poll="1" />
</int-sftp:inbound-channel-adapter>

<int:channel id="receiveChannel">
</int:channel>

<int:service-activator input-channel="receiveChannel"
    method="handleSftp" ref="messageHandler" output-channel="nullChannel" auto-startup="true">
</int:service-activator>

0 个答案:

没有答案