I have a process that processes an input file, uses 100% of the processor (uses the 16 cores), and 8 GB of RAM. I currently run it directly from the console. But I need to call this process from a REST service. The service must be asynchronous, and there will be another service to check the exit of the first service called. The input files must be pasted, because only one can be processed at a time. I use RestEasy in Wildfly.
My query is:
What architecture do you suggest to call this process?
I have these possible solutions.
-
Call from my EJB to the JAR with Runtime. And have a queue of files in a database.
-
Transform my JAR into a Demon, which is constantly monitoring a directory. And the files are stored there. And let the devil take the files one by one according to the arrival date.
-
Copy the classes in my EAR project, and call them as a simple EJB, and wildfly administer the resources. This would also imply having a queue of files in a database.
Do you have any other suggestions?