How to execute a very heavy process exposed as REST services from wildfly?

Viewed 365

I have a process that processes an input file, uses 100% of the processor (uses 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 consult the output of the first service called. The input files must be queued, because it can only be processed one at a time.

I use RestEasy on Wildfly.

My query is:

What architecture do you suggest to call this process?

I have these possible solutions.

  • Call from my EJB to 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 they will be storing the files there. And that the demon took one by one the files according to the date of arrival.

  • Copy the classes in my EAR project, and call them as a simple EJB, and let wildfly manage the resources. This would also imply having a file queue in a database.

Do you have any other suggestions?

2 Answers
Related