Mule3.2.0のCollectionAggregatorを使用しようとしています。Mule Studioを使用してみましたが、[フロー制御]セクションにアイコンが表示されますが、MuleStudioではまだ構成に使用できないようです。私のユースケースは-VMインバウンドエンドポイントからメッセージを受け取ります。これを3つの異なるフローに渡したいと思います。すべて同じリクエストオブジェクトを使用しますが、異なる操作を実行します。たとえば、A、B、Cです。それらはすべてそれぞれのデータベースを更新しますが、それらはすべて共通のOrder_ID(アプリケーションの内部にあるもの)の一部です。3つのプロセスは異なる処理時間を要する場合がありますが、一度実行されると、それぞれが同じ成功応答を返します。タイムアウトせずにこれらすべての応答を集約し、それをJavaコンポーネントまたは別のVMエンドポイントに転送してさらに処理するアグリゲーターを使用したいと思います。
2 に答える
Instead of Collection Aggregator
use All
message processor. It sends the same message to every processor inside it and aggregates the results after they finish.
Sample config: (I send "foo" to the vm endpoint)
<flow name="main" processingStrategy="asynchronous">
<vm:inbound-endpoint path="in"/>
<all>
<flow-ref name="flow1"/>
<flow-ref name="flow2"/>
</all>
<logger message="#[payload:]" level="INFO"/>
</flow>
<flow name="flow1">
<append-string-transformer message="bar1"/>
</flow>
<flow name="flow2">
<append-string-transformer message="bar2"/>
</flow>
Console output:
INFO 2012-08-15 17:26:01,749 [main.stage1.02] org.mule.api.processor.LoggerMessageProcessor: [foobar1, foobar2]
HTH
I would go with to use ALL component and the endpoint you use should be request-response (two-way where the flow waits for the response).
Thus the ALL component will aggregate the response an then returns you a CopyOnWriteArrayList with all the response from the flows A,B and C. This Array list you can transform in any desired way using a custom transformer by extending AbstractTransformer in your java class.
Cheers, Naveen Raj