1

Can someone help me with mule scatter gather component. My requirement is if any of the flow fails then the other flows need not be executed and the exception needs to be thrown to the UI specifying the extact expection thrown from the failed API flow?

Thanks in advance!!!

Shilpa
  • 101
  • 14

1 Answers1

1

You do not want to use a Scatter-Gather for this. Scatter-Gather will execute all flows even if one of them fails; it's asynchronous. If you have flows that will run depending on if other flows ran successfully, you need this to be synchronous.

jerney
  • 2,187
  • 1
  • 19
  • 31
  • Thanks fo rthe response.But the input is same for both the flows hence I need to use scatter gather and make parallel calls.Is there any way I can stop the flow using scatter gather and throw the exception received from failed API – Shilpa Aug 22 '18 at 14:49
  • 1
    First, it's a misconception that you need the scatter-gather to get the same input for all calls. Wrap the flows in a message enricher and you will be able to send the same payload to all flows. The enricher will keep the wrapped flow from modifying the payload unless you explicitly tell it to. – jerney Aug 22 '18 at 14:58
  • 1
    Second, no, there is no way you can stop flows from within a scatter-gather. At least none that I know of. – jerney Aug 22 '18 at 14:59
  • You can make execute scatter gather routes one after the other (synchronously) by providing threads = 1 – Prudhvi B Aug 31 '18 at 09:33