2015-03-31 38 views
0
Below is my mule flow. I want to move my corresponding from the jdbc query rseult set 

---------------------------------------------------- 


<foreach doc:name="Foreach" counterVariableName="#[message.payload.size()]"> 
     <logger message="#[payload.filepath] - #[payload.name] - #[payload.filename]" level="INFO" doc:name="Logger" /> 
    </foreach> 

--------------------------------------------------------------------- 

<jdbc-ee:postgresql-data-source name="PostgreSQL_Data_Source" 
        user="postgres" password="postgres" url="jdbc:postgresql://localhost:5432/postgres" 
        transactionIsolation="UNSPECIFIED" doc:name="PostgreSQL Data Source"> 
    </jdbc-ee:postgresql-data-source> 
     <jdbc-ee:connector name="JDBCConnector" 
        dataSource-ref="PostgreSQL_Data_Source" validateConnections="true" 
        doc:name="JDBCConnector"> 
     <jdbc-ee:query key="emprec" value="select * from emp where salary>50000";"> 
     </jdbc-ee:query> 
    </jdbc-ee:connector> 
     <flow name="empflow" > 
     <quartz:inbound-endpoint responseTimeout="10000" 
         doc:name="Quartz" jobName="CronJobSchedule" repeatInterval="0" 
         cronExpression="0 0/1 * ? * MON-FRI" repeatCount="1"> 
      <quartz:event-generator-job> 
      <quartz:payload>quartzSchedular started</quartz:payload> 
      </quartz:event-generator-job> 
     </quartz:inbound-endpoint> 
     <jdbc-ee:outbound-endpoint queryKey="emprec" 
         queryTimeout="-1" connector-ref="JDBCConnector" exchange-pattern="request-response" 
         doc:name="Database" /> 
     <logger message="Size of payload is ::: #[message.payload.size()]" level="INFO" doc:name="Logger"/> 

     <foreach doc:name="Foreach" counterVariableName="#[message.payload.size()]"> 
      <logger message="#[payload.filepath] - #[payload.name] - #[payload.filename]" level="INFO" doc:name="Logger" /> 
     </foreach> 
     </flow> 

請建議的方式來移動使用查詢結果有任何文件名,該文件需要移動其他位置 內部每個迴路我試圖文件入站和出點。但它沒有解決騾子從一個文件夾移動多個文件到其他內部每個迴路

+0

似乎與http://stackoverflow.com/questions/29372873/mule-move-file-to-another-location-dynamically-from-the-db-query/29383972#29383972 – Petter 2015-04-01 06:27:38

回答

0

1 - 您需要加載文件,爲此我建議使用Mule Requester Module。你可以在這個blogpost找到更多。

2 - 之後,您可以使用文件出站端點來移動它。

下面是一個例子:

<mulerequester:request config-ref="Mule_Requester" resource="file:///Users/anafelisatti/test.txt" returnClass="java.lang.String" doc:name="Mule Requester"/> 
<file:outbound-endpoint responseTimeout="10000" doc:name="File" outputPattern="test.txt" path="/Users/anafelisatti/Documents"/> 

希望有所幫助。

相關問題