-1
我有一個zip文件在未來的某個文件的入站端點後傾已損壞。如果我使用一個文件出站端點與輸出模式騾子zip文件的目錄與文件出站端點
[message.outboundProperties.originalFileName]
流動過程中發生錯誤
該壓縮文件然後損壞,無法打開的窗口。該zip文件的大小也增加了。任何人都知道發生了什麼事?
代碼
</spring:beans>
<file:connector name="fileConnectorNonStreaming"
autoDelete="true" doc:name="File" streaming="false"
validateConnections="true">
<service-overrides messageFactory="org.mule.transport.file.FileMuleMessageFactory" />
</file:connector>
<smtp:connector name="SMTP" validateConnections="true"
doc:name="SMTP" />
<file:connector name="fileStreamingConnector"
autoDelete="true" streaming="true" validateConnections="true"
doc:name="File" />
<custom-transformer class="org.mule.transformer.simple.ObjectToString"
name="ObjectToStringTransformer" doc:name="Java"></custom-transformer>
<jdbc:connector name="JDBC" dataSource-ref="MySQL_Data_Source"
validateConnections="true" queryTimeout="-1" pollingFrequency="0"
doc:name="JDBC">
<jdbc:query key="commitFileNames"
value="insert into ${sta.database.source.table} (NAME, REF, DATE, TIME, DESCRIPTION) values (#[message.payload[0].toString()], #[message.payload[1].toString()], (DATE_FORMAT(STR_TO_DATE(#[message.payload[2].toString()], '%d-%m-%Y'), '%Y-%m-%d')) , #[message.payload[3].toString()], #[message.payload[4].toString()]) ON DUPLICATE KEY UPDATE S_FILENAME = #[message.payload[0].toString()], S_DEBTREF = #[message.payload[1].toString()], S_DATE = (DATE_FORMAT(STR_TO_DATE(#[message.payload[2].toString()], '%d-%m-%Y'), '%Y-%m-%d')), S_TIME = #[message.payload[3].toString()] ,S_DESCRIPTION = #[message.payload[4].toString()]" />
</jdbc:connector>
<jdbc:mysql-data-source name="MySQL_Data_Source"
user="root" password="root" url="${database.mysql.url}${database.schema}"
transactionIsolation="UNSPECIFIED" doc:name="MySQL Data Source" />
<flow name="getfilenames" doc:name="getfilenames">
<file:inbound-endpoint doc:name="File"
responseTimeout="10000" path="${csv.zipped.files}" connector-ref="fileConnectorNonStreaming"
fileAge="2000"></file:inbound-endpoint>
<set-variable variableName="unzippedFilesDestinationPath"
value="${csv.unzipped.files.archive}" doc:name="Store the path of the target file to be unzipped" />
<set-variable variableName="targetFileName" value="${file.compressed.name}"
doc:name="Store the file name of the target file to be unzipped" />
<component class="com.mule.file.FileDeleter"
doc:name="Delete unzipped file from directory" />
<set-variable variableName="sourceZipFile" value="#[payload]"
doc:name="Store the incoming zip file" />
<component class="com.mule.file.ZipDeCompressor"
doc:name="Unzip and aquire target csv file" />
<set-variable variableName="unzippedFile" value="#[payload]"
doc:name="Store the unzipped file" />
<component class="com.influentialsoftware.sta.mule.csv.CsvParser"
doc:name="Parse CSV and validate" />
<foreach doc:name="For Each">
<jdbc:outbound-endpoint queryKey="commitFileNames"
connector-ref="JDBC" doc:name="Insert data" exchange-pattern="one-way"
queryTimeout="-1"></jdbc:outbound-endpoint>
</foreach>
<choice-exception-strategy doc:name="Choice Exception Strategy">
<catch-exception-strategy doc:name="Catch Exception Strategy"
when="#[exception.causedBy(java.io.IOException)]">
<file:outbound-endpoint path="${file.base.directory.errors}"
outputPattern="#[message.outboundProperties.originalFileName]"
responseTimeout="10000" connector-ref="fileStreamingConnector"
doc:name="toError"></file:outbound-endpoint>
流量配置或我們無法幫助。 –