1

私は3.3.0を使用して、Muleにかなり慣れていませんが、かなりストックの例であると思うものを試しています。csvファイルを読み取り、異なるフローの行と列を非同期で処理しようとするラバ設定があります。ただし、メッセージが非同期フローの1つに「ハンドオフ」されているときに、ConcurrentModificationExceptionが発生します。他の誰かがこの問題を見たことがあり、問題を回避するために彼らが何をしたのだろうかと思っていました。

java.util.ConcurrentModificationException at org.apache.commons.collections.map.AbstractHashedMap $ HashIterator.nextEntry(AbstractHashedMap.java:1113)at org.apache.commons.collections.map.AbstractHashedMap $ KeySetIterator.next(AbstractHashedMap.java:938 )at org.mule.DefaultMuleEvent.setMessage(DefaultMuleEvent.java:933)at org.mule.DefaultMuleEvent。(DefaultMuleEvent.java:318)at org.mule.DefaultMuleEvent。(DefaultMuleEvent.java:290)at org.mule.DefaultMuleEvent .copy(DefaultMuleEvent.java:948)

 <queued-asynchronous-processing-strategy poolExhaustedAction="RUN" name="commonProcessingStrategy" maxQueueSize="1000" doc:name="Queued Asynchronous Processing Strategy"/>

<file:connector name="inboundFileConnector" fileAge="1000" autoDelete="true" pollingFrequency="1000" workDirectory="C:/mule/orca/dataprovider/work"/>

<file:endpoint name="dataProviderInbound" path="C:\mule\orca\dataprovider\inbound" moveToPattern="#[function:datestamp]-#[header:originalFilename]" moveToDirectory="C:\mule\orca\dataprovider\history" connector-ref="inboundFileConnector" doc:name="Data Feed File" doc:description="new files are processed in 'work' folder, then moved to 'archive' folder"/>

<flow name="dataProviderFeedFlow">
    <inbound-endpoint ref="dataProviderInbound"/>
    <file:file-to-string-transformer />
    <flow-ref name="dataSub"/>
</flow>

<sub-flow name="dataSub" >

    <splitter expression="#[rows=org.mule.util.StringUtils.split(message.payload, '\n\r')]" />
    <expression-transformer expression="#[org.mule.util.StringUtils.split(message.payload, ',')]" />
    <foreach>

        <flow-ref name="storageFlow" />
        <flow-ref name="id" />            

     </foreach>

</sub-flow>

<flow name="storageFlow" processingStrategy="commonProcessingStrategy">
    <logger level="INFO" message="calling the 'storageFlow' sub flow."/>
</flow>

<flow name="id" processingStrategy="commonProcessingStrategy">
    <logger level="INFO" message="calling the 'id' sub flow."/>
</flow>
4

1 に答える 1

4

正常に動作するサブフローの修正バージョンを次にdataSub示します。

<sub-flow name="dataSub">
    <splitter expression="#[org.mule.util.StringUtils.split(message.payload, '\n\r')]" />
    <splitter expression="#[org.mule.util.StringUtils.split(message.payload, ',')]" />
    <flow-ref name="storageFlow" />
    <all>
        <async>
            <flow-ref name="storageFlow" />
        </async>
        <async>
            <flow-ref name="id" />
        </async>
    </all>
</sub-flow>

次の点に注意してください。

  • 2 つのスプリッタ式を使用します。
  • メッセージ プロセッサを使用しallて、同じペイロードが両方のプライベート フローに送信されるようにします。
  • フロー参照をメッセージ プロセッサでラップする必要があります。そうしないと、プライベート フローは非同期ですが同期が強制さasyncれるため、呼び出しが失敗します。all
于 2013-03-05T19:44:49.897 に答える