Created
May 22, 2017 09:07
-
-
Save zregvart/149491613f3d3f009b80f6e75c9d2df5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ExampleProcessor implements Processor { | |
@Override | |
public void process(Exchange exchange) throws Exception { | |
try { | |
// do your transformation here | |
} catch (ExampleException e) { | |
final List<ExampleException> allExceptions = Optional | |
.ofNullable(exchange.getProperty("all-exceptions", List.class)).orElseGet(ArrayList::new); | |
allExceptions.add(e); | |
exchange.setProperty("all-exceptions", allExceptions); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment