You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Claus Ibsen <cl...@gmail.com> on 2018/12/05 10:06:06 UTC

Re: large xml files using groovy

Hi

How is reading an XML file via Java code related to a SOAP endpoint?

Yeah you can read xml files in a streaming mode via a reader. Mind
that it depends what you need to do with the XML data whether you need
to read the entire XML into memory and build a DOM tree etc.
20mb is not so large anymore, so reading into memory should be fine imho.

And yeah for streaming you may need that, but it depends what you do,
and what Camel need to do.


On Mon, Nov 26, 2018 at 10:19 AM Raymond de Hond
<ra...@gmail.com> wrote:
>
> Hi,
>
> I created a camel route using a soap endpoint (contract first) using format
> PAYLOAD.
>
> My question is, what's the best approach to read large xml messages (up to
> 20mb)  using groovy xmlSlurper? This slurper accepts a java.io.Reader as
> input. Is it possible to do something like:
>
>
> def xml = exchange.getIn().getBody(java.io.Reader);
>
>
> And should I enable streamCache = true on my route?
>
>
> Regards,
>
>
> Raymond



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2