我的流程定义如下:
<mule xmlns:scripting="http://www.mulesoft.org/schema/mule/scripting" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns:tracking="http://www.mulesoft.org/schema/mule/ee/tracking" 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" version="EE-3.4.0" 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/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd
http://www.mulesoft.org/schema/mule/scripting http://www.mulesoft.org/schema/mule/scripting/current/mule-scripting.xsd
http://www.mulesoft.org/schema/mule/ee/tracking http://www.mulesoft.org/schema/mule/ee/tracking/current/mule-tracking-ee.xsd">
<flow name="testFlow1" doc:name="testFlow1">
<file:inbound-endpoint path="/home/fiscrm/Pulpit/pliki/tif" responseTimeout="10000" doc:name="File" disableTransportTransformer="true"/>
<file:file-to-byte-array-transformer ignoreBadInput="true" doc:name="File to Byte Array"/>
<scripting:transformer ignoreBadInput="true" doc:name="Groovy">
<scripting:script engine="Groovy"><![CDATA[println "TEST"
//
return [fileName: 'test', data: payload.encodeBase64().toString(), user: 'god', password:'god']]]></scripting:script>
</scripting:transformer>
<http:outbound-endpoint exchange-pattern="one-way" host="localhost" port="8080" path="invoice/document" method="POST" disableTransportTransformer="true" responseTimeout="1200000" doc:name="HTTP" mimeType="binary/octet-stream"/>
</flow>
</mule>
输入文件很小时,一切正常。当我在更大的文件上尝试它时,http请求(出站)没有数据。
日志:
INFO 2013-04-25 08:15:57,525 [[fisbps-aoutoonline].File.receiver.01] org.mule.transport.file.FileMessageReceiver: Lock obtained on file: /home/fiscrm/Pulpit/pliki/tif/dat-1-002.tif
INFO 2013-04-25 08:15:57,927 [[fisbps-aoutoonline].connector.http.mule.default.dispatcher.01] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default outbound transformer: org.mule.transport.http.transformers.ObjectToHttpClientMethodRequest
INFO 2013-04-25 08:15:57,933 [[fisbps-aoutoonline].connector.http.mule.default.dispatcher.01] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default response transformer: org.mule.transport.http.transformers.MuleMessageToHttpResponse
INFO 2013-04-25 08:15:57,965 [[fisbps-aoutoonline].connector.http.mule.default.dispatcher.01] org.mule.transport.service.DefaultTransportServiceDescriptor: Loading default outbound transformer: org.mule.transport.http.transformers.ObjectToHttpClientMethodRequest
INFO 2013-04-25 08:15:57,966 [[fisbps-aoutoonline].connector.http.mule.default.dispatcher.01] org.mule.lifecycle.AbstractLifecycleManager: Initialising: 'connector.http.mule.default.dispatcher.2043296531'. Object is: HttpClientMessageDispatcher
INFO 2013-04-25 08:15:57,972 [[fisbps-aoutoonline].connector.http.mule.default.dispatcher.01] org.mule.lifecycle.AbstractLifecycleManager: Starting: 'connector.http.mule.default.dispatcher.2043296531'. Object is: HttpClientMessageDispatcher
INFO 2013-04-25 08:15:58,016 [[fisbps-aoutoonline].connector.http.mule.default.dispatcher.01] org.mule.transport.http.transformers.ObjectToHttpClientMethodRequest: Content-Type not set on outgoing request, defaulting to: text/plain
WARN 2013-04-25 08:15:58,673 [[fisbps-aoutoonline].connector.http.mule.default.dispatcher.01] org.apache.commons.httpclient.HttpMethodBase: Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
ERROR 2013-04-25 08:15:58,673 [[fisbps-aoutoonline].connector.http.mule.default.dispatcher.01] org.mule.transport.http.HttpClientMessageDispatcher: [{"field":"user","message":"Property [user] of class [class pl.fissst.integration.mule.RecognizeAutoonlineDocumentCommand] cannot be null"},{"field":"password","message":"Property [password] of class [class pl.fissst.integration.mule.RecognizeAutoonlineDocumentCommand] cannot be null"},{"field":"fileName","message":"Property [fileName] of class [class pl.fissst.integration.mule.RecognizeAutoonlineDocumentCommand] cannot be null"}]
ERROR 2013-04-25 08:15:58,692 [[fisbps-aoutoonline].connector.http.mule.default.dispatcher.01] org.mule.exception.DefaultMessagingExceptionStrategy:
答案 0 :(得分:0)
这可能是文件大小太大而且读取文件的时间较少且只占文件的一半或一半的原因。
为此,您需要使用文件端点的“文件年龄”属性。
请点击以下链接,其中包含文件年龄的详细信息
http://www.mulesoft.org/documentation/display/current/File+Endpoint+Reference