...
Info |
title |
Splitting big XML payloads |
|
The XPath engine in Java and saxon will load the entire XML content into memory. And thus they are not well suited for very big XML payloads. Instead you can use a custom _expression_ which will iterate the XML payload in a streamed fashion. From Camel 2.9 onwards you can use the Tokenizer language which supports this when you supply the start and end tokens. From Camel 2.14, you can use the XMLTokenizer language which is specifically provided for tokenizing XML documents. |
You can split streams by enabling the streaming mode using the streaming
builder method.
...
Available as of Camel 2.14
The second tokenizer that uses a StAX parser to overcome these limitations. This tokenizer recognizes XML namespaces and also handles simple and complex XML structures more naturally and efficiently.
To split using this tokenizer at {urn:shop}order, we can write
...