camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wcma <wing...@gmail.com>
Subject Process many subdirectories
Date Fri, 06 Jan 2017 22:21:50 GMT
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.

Mime
View raw message