Camel - how to make delimiter stop on exception and return aggregated result along with the exception

How to implement such a process with a camel:

  • split
  • handle every broken item
  • aggregated results

    If an exception occurs:

  • end of division
  • returns the result of the aggregation of all elements before the exception, along with information about the exception

By defining .stopOnException () in split, I can achieve stopping the process and outputting information about the exception without an aggregated result.

Is it possible, if you handle the exception from the force separator of the aggregation strategy, to stop processing all remaining items?

+3


source to share


1 answer


I believe what you are saying is that the Split exchange stops after the exception.

on camel 2.2 your sub-exchanges will be processed and if there are any exceptions further messages will be processed as well, and in aggregation you can watch / analyze this.



.stopOnExceptions(false)

      

Camel 2.2: stop or do not continue, continue processing immediately after an exception is thrown. If disabled, Camel will continue to split and process auxiliary messages regardless of whether one of them succeeds. You can deal with exceptions in the AggregationStrategy class, where you have complete control over how to handle it.

0


source







All Articles