2017-03-29 10 views
0

フローがSFTPの場所からファイルを読み取り、ローカルディレクトリにダンプするmulesoft xmlを提供できますか?SFTPからファイルを読み取り、mulesoftを使用してローカルフォルダにダンプします

私は、次のコード書かれているが、それは動作しません: サブフロー:

<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" /> 

答えて

0

official documentationからの例です。

configuation:

<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> 

、ここで参照するプロパティファイル:

sftp.user=memyselfandi 
sftp.host=localhost 
sftp.port=8081 
sftp.password=icannottellyou 

はそれを試してみると、より正確なqueationをお気軽に。

+0

次のエラーが発生しています:org.mule.module.launcher.DeploymentStartException:IOException:$ {user}へのログイン中にエラーが発生しました@ $ {host}:アルゴリズムネゴシエーションに失敗しました –

+0

例外+スタックトレース、thx – Yevgeniy

関連する問題