Tuesday, March 28, 2017

flow-ref and processing strategy

Leave a Comment

Can someone pls explain how a Mule processing strategy works when one flow is calling another one with flow-ref?

Case 1.
Let's say we have 2 flows: flowA and flowB, with processing strategies procA and procB, both are asynchronous but procA has 10 threads allowed while procB has only 1.

<queued-asynchronous-processing-strategy name="procA" maxThreads="10" doc:name="procA"/> <queued-asynchronous-processing-strategy name="procB" maxThreads="1" doc:name="procB"/> 

flowA is reading from a queue and calling flowB with

<flow-ref name="flowB" doc:name="flowB"/> 

Will be another queue created in this case between the flowA and flowB so that all the flowB calls executed in a single thread one by one?
Or flowB will be following the flowA strategy with possible 10 messages processed at the same time?

Case 2.

flowA is a synchronous flow reading from a queue. It's calling an asynchronous flowB with 1 max thread allowed like this:

<queued-asynchronous-processing-strategy name="procB" maxThreads="1" doc:name="procB"/> 

The async block has it's own strategy procC with 10 threads allowed:

<queued-asynchronous-processing-strategy name="procC" maxThreads="10" doc:name="procC"/>   

flowA is calling flowB like this:

<async doc:name="Async" processingStrategy="procC"> <flow-ref name="flowB" doc:name="flowB"/> </async> 

The question is similar:
Will be another queue created in this case between the async block and flowB so that all the flowB calls executed in a single thread one by one?
Or flowB will be following the procC strategy with 10 messages processed at the same time?

1 Answers

Answers 1

Case 1.

Another queue with 1 thread will be created for Flow B.

VM receiver pool thread-> SEDA thread from procA -> SEDA thread from procB

Case 2.

As above, another queue with 1 thread will be created for Flow B

VM Receiver pool thread -> SEDA thread from procC -> SEDA thread from procB

Flow processing strategies are covered in the Mule documentation but I didn't find that overly useful. It is straightforward to set these flows up in Anypoint Studio and use Loggers to determine the thread that is running at a particular time.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment