从SFTP读取文件并使用mulesoft转储到本地文件夹

从SFTP读取文件并使用mulesoft转储到本地文件夹,mule,mule-studio,Mule,Mule Studio,有人能给我提供一个mulesoft xml,其中流从SFTP位置读取文件并将其转储到本地目录 我已经编写了以下代码,但不起作用: 子流: <sub-flow name="loadFtpFile"> <logger message="Load FTP File: #[flowVars.fileName]" level="INFO" doc:name="Load FTP File"/> <logger message="#[payload]" l

有人能给我提供一个mulesoft xml,其中流从SFTP位置读取文件并将其转储到本地目录

我已经编写了以下代码,但不起作用: 子流:

    <sub-flow name="loadFtpFile">
    <logger message="Load FTP File: #[flowVars.fileName]" level="INFO" doc:name="Load FTP File"/>
    <logger message="#[payload]" level="DEBUG" doc:name="Log Payload"/>
</sub-flow>

流程是:

<flow name="readFTP">
     <logger message="Read FTP file" level="INFO" doc:name="Read FTP file"/>
    <set-variable variableName="sftpEndpoint" value="sftp://{someUser}:{password}@{host}:22/incoming/test" doc:name="Set SFTP Endpoint"/>
    <set-variable variableName="fileName" value="debug.log" doc:name="Set File Name"/>
    <flow-ref name="loadFtpFile" doc:name="loadFtpFile"/>
   <file:outbound-endpoint path="C:\Users\Vikas\home\product" responseTimeout="10000" doc:name="Templocation" />


以下是来自的示例

配置:

<mule xmlns="http://www.mulesoft.org/schema/mule/core"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:sftp="http://www.mulesoft.org/schema/mule/sftp"
      xmlns:file="http://www.mulesoft.org/schema/mule/file"
      xmlns:spring="http://www.springframework.org/schema/beans"
      xsi:schemaLocation="
          http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
          http://www.mulesoft.org/schema/mule/sftp http://www.mulesoft.org/schema/mule/sftp/current/mule-sftp.xsd
          http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
          http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd">

    <!-- This placeholder bean lets you import the properties from the sftp.properties file. -->
    <spring:bean id="property-placeholder" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <spring:property name="location" value="classpath:sftp.properties"/>
    </spring:bean>

    <flow name="sftp2file">
        <sftp:inbound-endpoint host="${sftp.host}" port="${sftp.port}" path="/home/test/sftp-files" user="${sftp.user}" password="${sftp.password}"> 
                    <file:filename-wildcard-filter pattern="*.txt,*.xml"/> 
                </sftp:inbound-endpoint>
        <file:outbound-endpoint path="/tmp/incoming" outputPattern="#[message.inboundProperties.originalFilename]"/> 
    </flow>
</mule>

试试看,可以问更精确的问题。

我遇到了以下错误:org.mule.module.launcher.DeploymentStartException:IOException:登录${user}@${host}时出错:算法协商失败听起来像是另一个问题。。。请使用例外+堆栈跟踪,thx
sftp.user=memyselfandi
sftp.host=localhost
sftp.port=8081
sftp.password=icannottellyou