Reputation: 321
I have 2 flows. FlowA receives calls (htp-inbound) and places message on a queue. FlowB picks up messages from this queue and enters until-successful loop. Until successful makes an outbound call.
<flowA>
<http-inbound/>
<put message on queueA/>
</flowA>
<flowB>
<jms:inbound queueA>
<until-successful>
<http-outbound/>
</until-successful>
</flowB>
I am running this in Debug mode with a breakpoint where outbound call is made within untilsuccessful. I see that every call creates a new thread (until-successful) till we reach 15. The 16th call onwards, since thread pool is full, execution is continued in flowB's thread. I see 16 more flowB threads created. After that, when flowA puts a message on the queue, flowB picks it up, but I'm unable to figure out where it goes next :( The messsage is lost! It is not trying to make any outbound call.
I'm thinking 16 is the default thread pool size.
What is the expected behavior when until-successful is blocked? I expected the messages to queue up when all threads are busy.
Please let me know if I need to rephrase the question.
I am running in debug mode and may have messed up...so....please bear with me.
Upvotes: 1
Views: 552
Reputation: 33413
You're right: 16 is the default thread pool size in Mule.
The message should not be lost: it should be accumulated in the until-successful
object store, waiting to be picked up as soon as one of the thread becomes available again.
The core issue is that until-successful
uses the default work manager which as a non-configurable threading profile. If it was possible to configure a custom threading profile, you would define a non-zero value for maxBufferSize
which would then accumulate messages instead of triggering the pool exhausted action (of course, until the buffer is full, but that is another issue).
But for now, there is really no way out. until-successful
is fixed with 16 threads the "if exhausted run" action.
This is a known issue: see point #1 here https://www.mulesoft.org/jira/browse/MULE-7035 Please upvote this JIRA.
Upvotes: 1