unmarshalling - Out of memory when unmarshaling the xml in camel dsl -


i m facing oom issue in below code

from("file://" + getdumpdirlocation() + "?maxmessagesperpoll=1&buffersize=8192")                 .unmarshal().string("utf-8") 

the xml file gets dumped @ directory location huge (sometimes 1g).

i tried adding custom processor - no success,

from("file://" + getdumpdirlocation() + "?maxmessagesperpoll=1&buffersize=8192") .process(this.getremoveinvalidxmlcharacterprocessor()) 

is there way avoid out of memory exception?

so exchange.getin().getbody(string.class) in processor throws oom object structure huge considering size of dumped xml file.

thanks.

its not idea read in 1gb of file memory. instead read file in "chunks" using streaming.

and if want process big xml files read of these articles, can find here: http://camel.apache.org/articles splitting big xml files. search on page xml, , can find links.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -