Hello everybody, I'm facing a very difficult requirement for an application that I'm developing.
The issue is that I have a restful web service and I use only two methods: POST and GET. In addition I have a Worker Thread which can be considered as a Daemon or a background thread. The flow of the application must be that some user sends a document to my REST using the POST Method, my POST Method gets the bytes of the message, process them into a DocumentBean and I put it on a Message broker. My worker thread is the java application which will be in charge of get the message from the broker and save it in an inbox path in the server. If all the flow is completed, the worker thread will set a boolean variable to true and if not, false and my post method is supposed to return an XML with tags <Response><code>200</code><message>OK</message></Response> and if it fails, it changes the code to 500 and message Error.
I've already tested the flow using a JUnitTest, what I don't have any idea is how my RestInterface will retrieve the status of the worker thread. Inside the POST method I'm converting the bytes to a Bean type and then I'm sending it to the Message Broker, then my worker thread do all the job, but how can I notify the rest that the process is complete to send the XML Response to the cliente?
Please I'll be really grateful if somebody could help me with this. Thank you very much for your time.