It must be asynchronous.
Since your web service call is RPC, it is best for the implementation to check the request, put it in the queue for processing, and immediately send a response that has a token or URL to check the progress.
Configure the JMS queue and register a listener that pulls the message out of the queue and saves it.
If it really takes 2-10 hours, I would recommend looking at your circuit and queries to see if you can speed it up. There, somewhere, somewhere, somewhere there is no pointer. I bet you.
source share