File Mule:两个文件出站端点和一个到同一位置的入站端点问题 .. .. .. .. .. .. .. ..

File Mule:两个文件出站端点和一个到同一位置的入站端点问题 .. .. .. .. .. .. .. ..,file,path,streaming,mule,endpoints,File,Path,Streaming,Mule,Endpoints,================================================= 我的前两个流具有相同的文件出站端点路径,第三个流的入站端点路径指向相同的文件夹位置。我得到一个错误: <flow name="flow1"..> .. <file:outbound-endpoint path="${workdir}/folder/inbox"/> .. .. </flow> <flow name="flow2"..>

=================================================

我的前两个流具有相同的文件出站端点路径,第三个流的入站端点路径指向相同的文件夹位置。我得到一个错误:

<flow name="flow1"..>
  ..
  <file:outbound-endpoint path="${workdir}/folder/inbox"/>
  ..
  ..
</flow>

<flow name="flow2"..>
  ..
  <file:outbound-endpoint path="${workdir}/folder/inbox"/>
  ..
  ..
</flow>

<flow name="flow3"..>
  <file:inbound-endpoint connector-ref="someConnector"
        path="${workdir}/folder/inbox"
        moveToDirectory="${global.workdir}/123"
        transformer-refs="Transformer"
        moveToPattern="#[header:originalFilename]-#[function:datestamp-yyyy-MM-dd_HH-mm-ss.SSS]" />
  ..
  ..
</flow>    
消息:未能通过端点路由事件:DefaultOutboundEndpoint{endpointUri=file://C:/temp/mule/data/vendors/inbound/856,connector=FileConnector
{
name=inboundFileConnector
生命周期=开始
这是c4092f
ConcurrentTransacticedReceiver的数量=4
CreateMultipleTransactedReceiver=true
已连接=真
supportedProtocols=[文件]
服务覆盖=
}
,name='endpoint.C.mule.data.vendors.inbound.856',mep=ONE_-WAY,properties={},transactionConfig=Transaction{factory=null,action=interference,timeout=0},deleteUnceptedMessages=false,initialState=started,responseTimeout=10000,endpointEncoding=UTF-8,disableTransportTransformer=false}。消息负载的类型为:ReceiverFileInputStream
代码:MULE_错误--2
--------------------------------------------------------------------------------
异常堆栈是:
1.流已关闭(java.io.IOException)
java.io.FileInputStream:-2(空)
2.未能通过端点路由事件:DefaultOutboundEndpoint{endpointUri=file://C:/mule/data/vendors/856,connector=FileConnector
{
name=inboundFileConnector
生命周期=开始
这是c4092f
ConcurrentTransacticedReceiver的数量=4
CreateMultipleTransactedReceiver=true
已连接=真
supportedProtocols=[文件]
服务覆盖=
}
,name='endpoint.C..mule.data.vendors.in.856',mep=ONE_-WAY,properties={},transactionConfig=Transaction{factory=null,action=interference,timeout=0},deleteUnceptedMessages=false,initialState=started,responseTimeout=10000,endpointEncoding=UTF-8,disableTransportTransformer=false}。消息负载的类型为:ReceiverFileInputStream(org.mule.api.transport.DispatchException)
org.mule.transport.AbstractMessageDispatcher:109(http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transport/DispatchException.html)
--------------------------------------------------------------------------------
根异常堆栈跟踪:
java.io.IOException:流已关闭
位于java.io.FileInputStream.readBytes(本机方法)
位于java.io.FileInputStream.read(未知源)
位于org.apache.commons.io.IOUtils.copyragle(IOUtils.java:1025)
+3个以上(为所有内容设置调试级别日志或“-Dmule.verbose.exceptions=true”)
=================================================

我可以在一个流中有两个出站端点,其路径与另一个流路径的入站端点相同吗

Message               : Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=file://C:/temp/mule/data/vendors/inbound/856, connector=FileConnector
{
  name=inboundFileConnector
  lifecycle=start
  this=c4092f
  numberOfConcurrentTransactedReceivers=4
  createMultipleTransactedReceivers=true
  connected=true
  supportedProtocols=[file]
  serviceOverrides=<none>
}
,  name='endpoint.C.mule.data.vendors.inbound.856', mep=ONE_WAY, properties={}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, endpointEncoding=UTF-8, disableTransportTransformer=false}. Message payload is of type: ReceiverFileInputStream
Code                  : MULE_ERROR--2
--------------------------------------------------------------------------------
Exception stack is:
1. Stream Closed (java.io.IOException)
  java.io.FileInputStream:-2 (null)
2. Failed to route event via endpoint: DefaultOutboundEndpoint{endpointUri=file://C:/mule/data/vendors/856, connector=FileConnector
{
  name=inboundFileConnector
  lifecycle=start
  this=c4092f
  numberOfConcurrentTransactedReceivers=4
  createMultipleTransactedReceivers=true
  connected=true
  supportedProtocols=[file]
  serviceOverrides=<none>
}
,  name='endpoint.C..mule.data.vendors.in.856', mep=ONE_WAY, properties={}, transactionConfig=Transaction{factory=null, action=INDIFFERENT, timeout=0}, deleteUnacceptedMessages=false, initialState=started, responseTimeout=10000, endpointEncoding=UTF-8, disableTransportTransformer=false}. Message payload is of type: ReceiverFileInputStream (org.mule.api.transport.DispatchException)
  org.mule.transport.AbstractMessageDispatcher:109 (http://www.mulesoft.org/docs/site/current3/apidocs/org/mule/api/transport/DispatchException.html)
--------------------------------------------------------------------------------
Root Exception stack trace:
java.io.IOException: Stream Closed
    at java.io.FileInputStream.readBytes(Native Method)
    at java.io.FileInputStream.read(Unknown Source)
    at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1025)
    + 3 more (set debug level logging or '-Dmule.verbose.exceptions=true' for everything)

..
..
..
..
.. ..

尝试禁用文件连接器中的流:

<flow name="flow1"..>
  ..
  <file:outbound-endpoint path="${workdir}/folder/inbox"/>
  ..
  ..
  <file:outbound-endpoint path="${workdir}/folder/inbox"/>
  ..
</flow>

然后在所有文件端点中引用此连接器

<file:connector name="sampleFileConnector"  streaming="false" ></file:connector> 


//需要将输入流转换为字节数组,以避免导线抽头将其关闭


将上述对象添加到字节数组转换器有助于转换输入流。

客座领主您是我的救世主:D
<file:outbound-endpoint connector-ref="sampleFileConnector" path="${workdir}/folder/inbox"/>
<object-to-byte-array-transformer/>