Can someone provide me an mulesoft xml where the flow is reading files from SFTP location and dumping it to the local directory.
I have written following code but it does not work: subflow :
<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>
And the flow is :
<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" />
here is a example from the official documentation.
configuation:
and here the references properties file:
try it out and feel free to ask more precise queation.