tomcat - Asynchronous processing in Java from a servlet -


I currently have a tomato container - the servlet that runs on it to listen to requests. I need the result of an HTTP request to submit for a job queue, which will then be processed asynchronously. I want to keep track of each "job" and in a row in DB for recovery in case of failure. I am studying a lot.

1) Use JMS - Active MQ (but in this case, who is the consumer of the work of another service?)

2) One of my request db Make the row. There is always a separate servlet in my tomcat container that always runs - it uses the utility to be used in quartz scheduler or java. Util Constants continuously use rows to act as tasks (using thread pooling).

I am leaning towards the latter because looking at the JMS document, I get a headache and when I know that this is a more robust solution which I need to implement this relatively soon. In the case of this server, I am not anticipating heavy load in the initial days of deployment.

Many people say that Spring 1 or 2 can be good for. Although I have never used spring and I do not even know how to start using it to solve this problem. Any sign of drowning will be useful without having to re-write my entire project

Otherwise, if you can weigh on options 1 or 2 which will be useful. Explanation: Asynchronous processing scraps a third-party web site, and sends a message notification to the original requestor. The third party web site is slightly flickering and slow and that is why it will be handled as an asynchronous process (built in many reti efforts). I'm also pulling files from that site and storing them in S3.

Your quartz job does not require a circlet! You can continue incoming jobs in DB and Quartz has started when your main service will start. Quartz Job can be a simple POJO and can periodically check DB for any jobs.

However, I would suggest to take a look at the spring. It is not hard to learn and you can get very good information in it, there is quartz integration, which is very easy to do manually.


Comments