Mule Exhausted Action RUN vs WAIT. Which one to choose and when

I have a question about the Mule Exhausted_Action thread profile. From the documentation, I understand that when the action is WAIT, any new request outside of maxActive will wait for the stream to be available. Whereas the RUN action will use the original thread to process the request. In my opinion, I thought WAIT was the best way to do this and not RUN. However, it looks like MULE has all the defaults set to RUN. Just want to hear comments about my understanding and differences between these two actions and how to decide which one to use when.

+3


source to share


1 answer


Your commitment to WAIT and RUN is correct.

The reason all the defaults are RUN is because message processing does not stop because the thread is unavailable. Since the original thread (or the receiver thread) is waiting anyway for the thread that is receiving the message and processing it, why not process it. (It's my opinion).

But there is a drawback to using RUN.

Example:

 No of receiver threads are restricted to 2.
 <asynchronous=processing-strategy name="customAsynchronous" maxThreads="1" />
 <flow name="sample" processingStrategy="customAsynchronous" >
    <file:inbound-endpoint ......>
    ............
    ..........
 </flow>

      



File sizes: 1 MB, 50 MB, 100 MB, 1 MB, 5 MB.

The above stream has 5 files in it. 3 files are processed because there is 1 stream and 2 streams of destination files (Exhausted_Action = RUN). The stream will finish processing quickly because the first file will be small and will wait for the next message. Unfortunately, the receiver thread, whose job it is to select the next file and pass it to the thread for processing, is busy processing the BIG file. Thus, there is a possibility that receiver threads will be hit by lengthy processing while the thread's threads are waiting.

So it always depends on what you are working with.

Hope it helps.

+4


source







All Articles