简体   繁体   中英

Mule multiple Batch processing

My flows are invoking multiple batch process. I want to process the batch in sequential ie

Batch-1->Batch-2->Batch-3->...

<quartz:inbound-endpoint jobName="Fetch" repeatInterval="0" repeatCount="0" responseTimeout="10000" doc:name="Quartz" startDelay="5000">
    <quartz:event-generator-job/>
</quartz:inbound-endpoint>
<scatter-gather doc:name="Scatter-Gather">
    <processor-chain doc:name="Processor Chain">
        <batch:execute name="Batch-1" doc:name="Batch-1"/>
        <logger message="==Batch-1 END==" level="INFO" doc:name="Logger"/>
        <batch:execute name="Batch-2" doc:name="Batch-2"/>
     </processor-chain>
</scatter-gather>

Here, it goes to Batch-1, enters input state of batch-1, after end of input phase, thread comes to Batch-2 then input phase of Batch-2. It doesn't wait for Batch-1 different STEPS of each batch to complete and process the Batch-2. How do I handle this? I tried with two process chain each batch in process chains separately, it didn't work out. Without scatter gather I am facing same issue.

Batch flows:

<batch:job name="Batch-1">
    <batch:input>
        <logger message="==Invoke query====" level="INFO" doc:name="Logger"/>
    </batch:input>
    <batch:process-records>
        <batch:step name="Batch_Step">                
            <flow-ref name="sfdc-query" doc:name="Flow Reference"/>
        </batch:step>
    </batch:process-records>
    <batch:on-complete>
        <logger level="INFO" doc:name="Logger" message="On Complete:#[message.payload]"/>           
    </batch:on-complete>
</batch:job>

EDIT

Now, I have 5 process, A,B,C,D,E. It should process first A then next process is all of(B,C,D) in parallel. Once after B and D finishes, finally E should process. C can process parallel with B & D. How do map this?

在Batch-1 Oncomplete Phase ,使用VM调用第二个流程(创建新流程),在第二个流程中使用批处理Execute调用Batch-2。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM