I have a
Download button in the UI below a text area. The user is supposed to drop something in the text area and click on the download button.
As soon as the user clicks on the download button, the following things are going to happen:
An ajax call sends some parameters to the REST endpoint.
REST Endpoint triggers a stored procedure(SP1). As soon as SP1 receives a list of parameters, it returns a key (integer ) and a message immediately back (using the
outparameter of the stored procedure).
The call to the above stored procedure(SP1) asynchronously launches another stored procedure (let’s say SP2) which is responsible for gathering data based on the parameters received from the SP1 and once its done, it will populate 4 different tables. This stored procedure (SP2) is going to take time.
Based on the
key returned from
SP1, I can check the status of this stored procedure (SP2) from time to time by querying another table in the database. This will return
So it seems like multiple calls(by multiple calls I mean, user put something in the text area, click on download button, after this user again put some other things in the text area and click on download button; this will call SP1 two times and will trigger two other stored procedures asynchronously) to SP1 would launch multiple stored procedures asynchronously and this is not going to block the user, right? I mean since the SP1 is returning something immediately, it’s not going to tie up the Ajax request forever, right? (Had SP1 was responsible for gathering the data(the job that SP2 is doing above), it would have taken long time and in this case I would have gotten request time out).
I was wondering do I need to use Java Message Service in this scenario to handle my asynchronous requests? I mean since SP1 is already returning something immediately and other procedure is asynchronously getting launched by calling SP1, I believe I don’t need JMS here, right?
From UI point of view, since I could check the status of the SP2 based on the