I'm developing an embedded Jetty app that needs to provide a rest interface for running processing jobs that last for an extended period of time (10-20 min). Additional complexity is the processing app is written in Python.
My current direction is to separate the platform into two sections:
- Jetty server handling processing requests and populating a db with the requests.
- Background Python job watching the db for new processing jobs, then running the processing as required.
My question is - can I realistically do this all under the Jetty server in Java, instead of having two separate processes? If so could you give me any pointers on how?
I can handle calling the Python processing module from Java using ProcessBuilder but I'm unsure on how to have embedded Jetty and separate processing service under a singe Java app at the same time.