Saturday, 28 September 2013

How write java batchprocess running from tomcat

How write java batchprocess running from tomcat

I'm writing spring web application that is running on TomCat.7 and one of
functionality will be a processing data from db using java.concurrency.
I expect that db processing will be a very time dealing because of
calculations, and I need high performance for this process.
My question is if it is good idea (or maybe only possibility) to run that
thread in TomCat container?
@RequestMapping(value = "run_process", method = RequestMethod.GET)
public RequestWrapper runProcess(ModelMap model) {
Runnable runCrawler = new Crawler();
runCrawler.run();
System.out.println("##run_process!");
return new RequestWrapper();
}
My project structure is like:
-src
-com.scanner.batchprocess
-com.scanner.crawler
-com.scanner.webapp.controllers

I don't have any experience in creating programs that are challenging
computationally, so I'm afraid that maybe I should create new clean java
project with main class that will be called from webapp whenever user run
BatchProcess. Can be a significant time difference in execution time
application from Tomcat than True java application?

No comments:

Post a Comment