1

我对流定义有问题,例如:

<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: 
4

1 回答 1

0

This could be a reason where the size of the file is too big and the time for reading file is less and only little or half of the file.

For this you need to use the "file age" attribute for the file endpoint .

Please follow the below link which has the details of the file age

http://www.mulesoft.org/documentation/display/current/File+Endpoint+Reference

于 2014-01-09T13:22:42.807 回答