Splitting messages and re-aggregating them using different criteria

The process described in the Splitting a message, and processing and gathering responses recipe broke up a message into fragments and aggregated those same processed fragments back into a result message that flowed out of a split block.

This recipe, which is a variant of the Composed Message Processor EIP, will describe how a message can be split up and aggregated, using criteria other than the original message ID. The aggregation phase may yield one or more aggregated messages.

In this example, we are going to accept, as input, XML messages that list books with titles and categories:

<books> <book category="Tech" title="Apache Camel Developer's Cookbook"/> <book category="Cooking" ...

Get Apache Camel Developer's Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.