I have an Apache Camel exchange that, as result of some processing, contains a Pair<List<Message>, List<Error>>. I want to split my Camel route into two paths, one only processing the Messages, and one only processing the Errors. Using a pseudo-DSL, I am looking for something like this:
split(MyPairSplitter::Class)
.to("direct:process-messages")
.to("direct:process-errors")
Now, this is not how the splitter EIP works. To my understanding, the splitter creates a sequence of exchanges that all have the same data type as body and that are all fed into a single route; but I would like to have two routes that process different data types. What is the best way to do this?