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
Post a Comment