2016-10-05 14 views
0

Mule 3.7.3で入力フォルダからCSVファイルを読み込み、何らかの処理を行い、元のCSVファイルを最後の出力フォルダに書き込むフローを作成しようとしていますすべてが正常に完了したときの流れのMuleのペイロードとしてCSVを設定できません

私は変数にCSVを保存し、出力ディレクトリにファイルを作成する前にこの変数を使用してペイロードを設定すると考えました。

フローで読み書きする2つのsftpコネクタがあっただけで、変換メッセージコネクタを追加したときに、出力フォルダに書き込まれたファイルが空であるか、エラーメッセージ。私はセットのペイロードコネクタがトランスフォームメッセージを上書きすることを期待していたので、問題があるとは考えられませんでした。

私はこれをどのように修正できるか知っていますか?

私が使用しているSFTPサーバーはCrushFTPです。

XMLの流れ:

<?xml version="1.0" encoding="UTF-8"?> 

<mule xmlns:mulexml="http://www.mulesoft.org/schema/mule/xml" xmlns:ftp="http://www.mulesoft.org/schema/mule/ftp" xmlns:metadata="http://www.mulesoft.org/schema/mule/metadata" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" xmlns:dw="http://www.mulesoft.org/schema/mule/ee/dw" xmlns:sftp="http://www.mulesoft.org/schema/mule/sftp" xmlns:batch="http://www.mulesoft.org/schema/mule/batch" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" 
    xmlns:spring="http://www.springframework.org/schema/beans" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd 
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.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/batch http://www.mulesoft.org/schema/mule/batch/current/mule-batch.xsd 
http://www.mulesoft.org/schema/mule/ee/ftp http://www.mulesoft.org/schema/mule/ee/ftp/current/mule-ftp-ee.xsd 
http://www.mulesoft.org/schema/mule/ee/dw http://www.mulesoft.org/schema/mule/ee/dw/current/dw.xsd 
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd 
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd 
http://www.mulesoft.org/schema/mule/ftp http://www.mulesoft.org/schema/mule/ftp/current/mule-ftp.xsd 
http://www.mulesoft.org/schema/mule/xml http://www.mulesoft.org/schema/mule/xml/current/mule-xml.xsd"> 
    <http:request-config name="HTTP_Request_Configuration" host="${host}" port="${orderprocess.port}" doc:name="HTTP Request Configuration"></http:request-config> 
    <sftp:connector name="SFTP" validateConnections="true" doc:name="SFTP" pollingFrequency="1000000"/> 
    <flow name="userFlow"> 
     <sftp:inbound-endpoint connector-ref="SFTP" host="localhost" port="2222" path="//input" user="${ftp.user}" password="${ftp.password}" responseTimeout="10000" doc:name="SFTP"/> 
     <set-variable variableName="storeCsv" value="#[payload]" mimeType="application/csv" doc:name="Store CSV"/> 
     <dw:transform-message doc:name="Transform Message"> 
      <dw:input-payload mimeType="application/csv"/> 
      <dw:set-payload><![CDATA[%dw 1.0 
%output application/java 
--- 
payload]]></dw:set-payload> 
     </dw:transform-message> 
     <set-payload value="#[flowVars.storeCsv]" mimeType="application/csv" doc:name="Set Payload"/> 
     <sftp:outbound-endpoint exchange-pattern="one-way" host="localhost" port="2222" responseTimeout="10000" doc:name="SFTP" connector-ref="SFTP" password="${ftp.password}" path="//output" user="${ftp.user}" outputPattern="#[message.inboundProperties.originalFilename+'.processed']"/> 
    </flow> 
</mule> 

CSV

1, user1 

答えて

0

ファイル<object-to-string-transformer/><sftp>後のコネクタ

+0

感謝しています。私はちょうど同じ時間にそれを働いていた:) – user3165854

関連する問題