我想使用 Mule 来移动和处理文件。我正在尝试使用流和“所有路由器”将相同的文件移动到不同的文件夹,但它失败了。
这有效:
<flow name="testflow2Flow1" doc:name="testflow2Flow1">
<file:inbound-endpoint path="C:\IN" fileAge="10000" responseTimeout="10000" doc:name="File"/>
<set-variable variableName="tempfilename" value="#[header:originalFilename]" doc:name="Variable"/>
<file:outbound-endpoint path="C:\OUT" responseTimeout="10000" doc:name="File"/>
</flow>
但是这个不行!
<flow name="testflow2Flow1" doc:name="testflow2Flow1">
<file:inbound-endpoint path="C:\IN" fileAge="10000" responseTimeout="10000" doc:name="File"/>
<set-variable variableName="tempfilename" value="#[header:originalFilename]" doc:name="Variable"/>
<all doc:name="All">
<processor-chain>
<file:outbound-endpoint path="C:\OUT" responseTimeout="10000" doc:name="File"/>
</processor-chain>
</all>
</flow>
我得到这个例外:
INFO 2013-10-03 20:22:19,072 [[testflow2].connector.file.mule.default.receiver.01] org.mule.transport.file.FileMessageReceiver:在文件中获得锁定:C:\IN\test。 txt.txt 错误 2013-10-03 20:22:19,088 [[testflow2].testflow2Flow1.stage1.02] org.mule.exception.DefaultMessagingExceptionStrategy:
消息:无法使用流有效负载复制消息。有效载荷类型是“org.mule.transport.file.ReceiverFileInputStream”。消息有效负载的类型:ReceiverFileInputStream
代码:MULE_ERROR--2
Exception stack is: 1. Cannot copy message with a stream payload. Payload type is "org.mule.transport.file.ReceiverFileInputStream". Message payload is of type: ReceiverFileInputStream (org.mule.api.MessagingException)
org.mule.routing.outbound.AbstractSequenceRouter:74 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/MessagingException.html)
Root Exception stack trace: org.mule.api.MessagingException: Cannot copy message with a stream payload. Payload type is "org.mule.transport.file.ReceiverFileInputStream". Message payload is of type: ReceiverFileInputStream at org.mule.routing.outbound.AbstractSequenceRouter.route(AbstractSequenceRouter.java:74) at org.mule.routing.outbound.AbstractOutboundRouter$1.process(AbstractOutboundRouter.java:105) at org.mule.routing.outbound.AbstractOutboundRouter$1.process(AbstractOutboundRouter.java:100) + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)