java - How to process large XML's in Apache Camel? -


i using apache camel 2.14.0 version. have created route poll directory containing xml's , pass on activemq broker.

from("file://d:/test?sortby=file:modified&include=test_.*.xml$&noop=true").to("activemq:queue:temp.xmlfilequeue"); 

it works fine small xml's (upto 20mb) if filesize more gives outofmemoryerror.

to avoid this, changed route below

from("file://d:/test?sortby=file:modified&include=test_.*.xml$&noop=true").split(body().tokenizexml("ship", "ships")).streaming().to("activemq:queue:temp.xmlfilequeue"); 

after doing this, see camel creating multiple threads process each chunk result of facing new issues. per logic after xml processed, should deleted - earlier single thread , fine due many threads, 1 thread deletes file thread still tries process file , throws filenotfoundexception.

how avoid this? please let me know proper way process large xml's single thread.


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -