I currently have a tomcat container - a servlet running on it that listens for requests. I need the HTTP request to be a representation in the job queue, which will then be processed asynchronously. I want each "task" to be stored in a row in the database for tracking and recovery in the event of a failure. I read a lot. Here are my options (note that I have to use open source material for everything).
1) JMS - use ActiveMQ (but who is the user of the job in this case of another servlet?)
2) Ask my query to create a row in the database. I have a separate servlet inside the Tomcat container that always works - it uses the Quartz scheduler or utilities provided in java.util.concurrent to continuously process strings as jobs (uses thread pooling).
I tend to the latter, because looking at the JMS documentation gives me a headache, and although I know this is a more reliable solution, I need to implement this relatively quickly. I do not expect huge loads in the early days of deploying this server anyway.
Many say that Spring can be good for 1 or 2. However, I never used Spring, and I did not even know how to start using it to solve this problem. Any pointers on how to dive without rewriting my entire project would be helpful.
Otherwise, if you could weigh option 1 or 2, which would also be useful.
Clarification: the asynchronous process should be to screen a third-party website and send a notification to the original requester. The third-party website is a little flaky and slow, and therefore it will be treated as an asynchronous process (several attempts at attempts are built-in). I will also pull files from this site and store them in S3.
source
share