- Jul 18, 2002
- 1,655
- 1
- 81
I am doing a bit of Java development (long time C# programmer) and I am unsure how to ask this question.
I have created a simple spring boot web app, but do not know the correct method or library to scale out the processor intensive pieces of it.
Below is the gist of how it currently works:
The way I want it to work is
RabbitMQ and JMS seem to almost be what I want, but I really do not want to message between applications, just have a global job queue.
Any advice ?
I have created a simple spring boot web app, but do not know the correct method or library to scale out the processor intensive pieces of it.
Below is the gist of how it currently works:
- A User or system posts a file to the web application
- The web application runs some code against the posted file and a result .txt file is created
- The web application reads the .txt file and inserts the results into a database
- The web application responds with where the results are located ((http://localhost:8080/someRestStuff/15))
The way I want it to work is
- A User or system posts a file to the web application
- The web application responds with "Hey, when your file is done being processed, it can be found here AT SOME POINT IN THE FUTURE.(http://localhost:8080/someRestStuff/15)" - http://farazdagi.com/blog/2014/rest-long-running-jobs/
- The web application adds the file to the processing queue (different thread, so the web app is always responding to requests)
- The web application checks the queue, sees there is a file to process. It creates the .txt result file and updates the database with the results. It checks the queue again when it is done and repeats...
- The User or system waits a little bit and hits the URL is was initially provided with and either gets the results or sees that there is no result so it has to wait longer.
RabbitMQ and JMS seem to almost be what I want, but I really do not want to message between applications, just have a global job queue.
Any advice ?