Mule - Send SFTP outbound message after Collection Split -
i using collection-splitter split list. how should set payload sftp outbound-endpoint.
<sftp:inbound-endpoint connector-ref="sftp-inbound" host="${sftp_host}" port="${sftp_port}" path="/files/" user="${sftp_user}" password="${sftp_pass}" responsetimeout="10000" pollingfrequency="30000" fileage="20000" sizecheckwaittime="5000" archivedir="/files/archive/" doc:name="sftp" > <file:filename-regex-filter pattern="test(.*).zip" casesensitive="true"/> </sftp:inbound-endpoint> <set-variable variablename="regexval" value="${regex}" doc:name="variable"/> <set-variable variablename="sourcefilename" value="#[flowvars.originalfilename]" doc:name="variable"/> <custom-transformer name="ziptxt" class="com.mst.transform.unziptransformer" doc:name="java" mimetype="image/gif"> <spring:property name="filenamepattern" value="*.csv,*.txt" /> </custom-transformer> <set-variable variablename="filecontents" value="#[payload]" /> <collection-splitter enablecorrelation="if_not_set" /> <logger message="#[payload]" level="info" doc:name="logger"/> <sftp:outbound-endpoint connector-ref="sftp-inbound" host="${sftp_host}" port="${sftp_port}" path="/files/" user="${sftp_user}" password="${sftp_pass}" responsetimeout="10000" doc:name="sftp" exchange-pattern="one-way"/> </flow>
if payload before collection splitter list of objects can consumed sftp outbound endpoint inputstream, after splitter, can wrap logger, sftp inside processor-chain. splitter send each object one-by-one processor chain. sftp should able write if inputsream.
<collection-splitter enablecorrelation="if_not_set" /> <processor-chain doc:name="processor chain"> <logger message="#[payload]" level="info" doc:name="logger"/> <sftp:outbound-endpoint connector-ref="sftp-inbound" host="${sftp_host}" port="${sftp_port}" path="/files/" user="${sftp_user}" password="${sftp_pass}" responsetimeout="10000" doc:name="sftp" exchange-pattern="one-way"/> </processor-chain>
you wouldn't need processor-chain if want put 1 processor (eg. sftp) after splitter.
if doesn't work, please add error details question.
Comments
Post a Comment