You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by wcma <wi...@gmail.com> on 2017/01/06 22:21:50 UTC
Process many subdirectories
Hi,
We have an app that needs to process all the subdirectories/files from a
parent directory. Within a subdirectory, there might be subdirectories
and/or files. Think of it as we want to process all the files from a
Windows C drive. What we notice is that there is an initial delay, 30+
minutes, before we can process the first file. Here is some snippet:
CamelContext context = new DefaultCamelContext();
context.setTracing(false);
context.disableJMX();
context.addRoutes(new RouteBuilder() {
@Override
public void configure() {
File file = new File("C:/");
from("file:///" + file.getAbsolutePath() +
"?noop=true&recursive=true").threads(20, 20)
.process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
// TODO Auto-generated method stub -- we do processing here...
logger.error("filename:" +
exchange.getIn().getHeader(Exchange.FILE_NAME));
}
}).stop();
}
});
context.start();
Thread.sleep(600000);
context.stop();
It might be limited by the I/O speed of the OS, but is there a way to speed
this up?
Thanks
--
View this message in context: http://camel.465427.n5.nabble.com/Process-many-subdirectories-tp5792263.html
Sent from the Camel - Users mailing list archive at Nabble.com.