0
votes

Mule batch is new for me, I'm not clear about few scenario's and the documentation was not so clear. Actually in my flow,

In my batch Input Phase - for example i'm getting some input phase exception (or loading phase Exception).How can i catch the exception and route it to my global exception strategy. (If it is normal flow, we have exception handling to handle it externally).

I'm planning to do a condition check for these exceptions in complete phase and route to global common error handling. Is the approach is correct ?

Could you plz any one help on me. I'm confused with this scenario's. Thanks in advance.

1

1 Answers

3
votes

In batch processing you don't handle exceptions as you normally do within the flows, the approach usually taken is to do appropriate batch steps which handle "Only_Failures" (this is set in the accept policy on the batch step). Otherwise you can encapsulate the logic within private flows and call these using flow-refs within the batch steps, this would allow you to use the usual exception handling. That said the correct approach is usually to use the batch steps with the "only_failures" accept policy.

If you need exception handling blocks within the input phase (which is not normally needed since the inbound endpoints usually produce global exceptions rather than message exceptions) you can put the input logic within a flow and use "batch execute" from within the flow instead of defining the input phase.