So I have been trying to figure out what could be the flow of events if I am planning to use JMS to handle long running stored procedure. I have a stored procedure(SP1), as soon as I call this stored procedure, it records the details of the request and returns a key and a message immediately.
There’s another procedure(SP2) that is launched asynchronously which is responsible for gathering data from tables and dump it into 4 different tables. I can keep track of the status (RUNNING, COMPLETE, ERROR)of the above request by querying another table. Since the above process is going to take hours, I am planning to use JMS here. So, what should be my plan of action here? Here’s what I was thinking : I get the parameters to call this stored procedure via REST end point. As soon as I call the stored procedure, I keep (my JMS Producer) sending some message in every few minutes to the JMS Queue. Wondering if this should be the status (RUNNING, COMPLETE , ERROR etc) that I can get from querying another table or something else? JMS Consumer would keep checking the message content every few minutes and as soon as it finds “COMPLETE”, I can query that asynchronous stored procedure(SP2) which is responsible for gathering data from 4 different tables. I hope while the above process is going on, if I decide to send a call to the SP1, let’s say via POSTMAN client, it won’t get stuck since the first one is already running? This is where I was thinking of taking advantage of JMS and making best use of it but not sure if everything I am trying to do above is correct or not. Please let me know if the above flow looks good/make sense or is there anything more efficient I could do to achieve my goal. Let me know if I could answer any more questions. Thanks -- Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-Dev-f2368404.html
