0
votes

I have flow where as inbound endpoint I have VM Queue. Now I want to run process as:

  1. VM inbound endpoint gets a message and starts a long running processing flow
  2. on VM inbound endpoint it then comes another messages (eg 10 messages) that would start another long running process but VM will keep the message in the queue until the first has completed
  3. Every message on VM queue has timeout to removed from queue after this time

How can I do this in MuleESB ?

1

1 Answers

1
votes

If it is a asynchronous flow you can use a processing strategy to limit the number of threads running a specific flow.

<queued-asynchronous-processing-strategy name="allowOneThread" maxThreads="1"/>

<flow name="OnlyOneAtTheTime" processingStrategy="allowOneThread">
    <vm:inbound-endpoint path="requestQueue" exchange-pattern="one-way" />
    <logger level="ERROR" message="Before sleep : #[payload]"/>
    <!-- Simulate long running processor -->
    <component class="Sleep" />
    <logger level="ERROR" message="After sleep : #[payload]"/>
    <vm:outbound-endpoint path="responseQueue"/>
</flow>

See the Mule documentation on processing strategies.