java - Apache Camel SEDA exception handling -
using apache camel, need perform xsd validation on xml files contained within zip files, exceptions resulting in zip file being shifted error folder.
the following (simplified) route works well*:
from("file:/my/path&movefailed=../error").split(new zipsplitter()). streaming().filter(header(exchange.file_name).endswith(".xml")). bean(mycustomvalidator.class).to("validator:schemas/my/schema.xsd").end();
in order improve efficiency, have tweaked use seda zip content checks:
from("file:/my/path&movefailed=../error").split(new zipsplitter()). streaming().filter(header(exchange.file_name).endswith(".xml")). to("seda:validateevents"); from("seda:validateevents?concurrentconsumers=20").bean(myvalidator.class). to("validator:schemas/my/schema.xsd").end();
however, movefailed
parameter isn't being honoured file component. if add explicit onexception()
, attempt copy files error folder, xsd validation failures copies xml files - not zip file - error folder.
how can perform parallel processing of component while maintaining error handling endpoint?
*i've used explicit file name filter zip file contents, otherwise splitter executes bean validator once each xml file in zip, , once more zip file (?!).
see shareunitofwork option at
and insted of using seda can use parallel processing in splitter.
Comments
Post a Comment