Spring Integration SFTP无法将文件移动到远程文件夹中的已处理

sree

我能够将文件从远程计算机复制到本地,但无法将文件移动到远程服务器中的已处理文件夹。

<bean id="sftpSessionFactory" class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory">
<property name="host" value="test.com"/>
<property name="user" value="test"/>
<property name="password" value="test123"/>
<property name="port" value="22"/>
</bean>

<int:publish-subscribe-channel id="publishToSFTPChannel" />

<sftp:inbound-channel-adapter local-directory="#{articlesLocalDirectory}"  filename-pattern="*.xml"  channel="publishToSFTPChannel" session-factory="sftpSessionFactory" remote-directory="#{articlesRemoteDirectory}">
<int:poller fixed-rate="12000"/>
</sftp:inbound-channel-adapter>


<file:outbound-channel-adapter id="moveProcessedFile"
session-factory="sftpSessionFactory" 
channel="publishToSFTPChannel"
directory="#{articlesRemoteDirectory}/processed"
delete-source-files="true"  />

我无法将文件移动到远程ftp中的已处理文件夹

德米特里·库斯科夫(Dmitry Kuskov)

我同意加里·罗素(Gary Russell)的观点,最好的方法是使用mv命令。但是,如果要使用当前版本,则可以尝试类似以下的配置:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:int="http://www.springframework.org/schema/integration"
   xmlns:sftp="http://www.springframework.org/schema/integration/sftp"
   xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/integration
        http://www.springframework.org/schema/integration/spring-integration.xsd
        http://www.springframework.org/schema/integration/sftp
        http://www.springframework.org/schema/integration/sftp/spring-integration-sftp-2.2.xsd">

<bean id="sftpSessionFactory" class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory">
    <property name="host" value="localhost"/>
    <property name="user" value="user01"/>
    <property name="password" value="abc123"/>
    <property name="port" value="990"/>
</bean>

<int:channel id="sftpChannel"/>

<sftp:inbound-channel-adapter local-directory="/tmp/test" filename-pattern="*.xml"
                              channel="sftpChannel" session-factory="sftpSessionFactory"
                              remote-directory="/">
    <int:poller fixed-rate="5000"/>
</sftp:inbound-channel-adapter>

<sftp:outbound-channel-adapter channel="sftpChannel" session-factory="sftpSessionFactory"
                               remote-directory="/processed"/>

</beans>

inbound-channel-adapter将文件从SFTP服务器下载到本地目录,然后outbound-channel-adapter将该文件的副本放在SFTP服务器上的/ processed文件夹中。

请注意,这绝对不是最佳选择,因为您必须将文件重新上传到SFTP。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

Spring Integration sftp移动远程文件问题

来自分类Dev

Spring Integration SFTP异常处理

来自分类Dev

Spring Integration Design - 处理文件中的行

来自分类Dev

Spring集成:处理后将文件移动到远程SFTP位置

来自分类Dev

Spring集成:处理后将文件移动到远程SFTP位置

来自分类Dev

使用 Spring Integration 中的 Java 配置从 SFTP 复制和移动文件

来自分类Dev

Spring Integration SFTP每天获取但立即处理

来自分类Dev

在Spring Integration中检测文件更改

来自分类Dev

在Spring Integration中验证架构

来自分类Dev

Spring Integration DSL 中的路由

来自分类Dev

在Spring Integration中需要并行处理多个文件

来自分类Dev

在Spring Integration DSL中配置Spring事务

来自分类Dev

Spring Integration sftp中的流处理期间休眠

来自分类Dev

使用Spring Integration SFTP文件入站通道适配器递归轮询远程目录

来自分类Dev

在Spring Integration中处理http响应

来自分类Dev

通过Spring-Integration下载FTP文件?

来自分类Dev

如何使用Spring Integration逐行读取文件

来自分类Dev

通过Spring-Integration下载FTP文件?

来自分类Dev

使用Spring Integration同时读取CSV文件

来自分类Dev

Spring Integration Zip-.gz文件

来自分类Dev

Spring Integration DSL SFTP良好实践

来自分类Dev

Spring Integration SFTP出站网关删除

来自分类Dev

Spring Integration文件处理将其发送到http

来自分类Dev

Spring Integration文件处理将其发送到http

来自分类Dev

Spring Integration网关线程是否已发布

来自分类Dev

拆分后的Spring Integration处理异常

来自分类Dev

Spring Integration DSL错误处理

来自分类Dev

Spring Integration TCP工厂错误处理

来自分类Dev

Spring Integration异步网关响应处理

Related 相关文章

热门标签

归档