0

Suppose I have a REST end point. UI sends some parameters to this REST end point which are required for a stored procedure to run properly. Since this stored procedure is going to take a long time to run, I am planning to use JMS and put this step to JMS Queue.

Now, I am not very clear about what to put in the JMS Queue here. Usually, whatever hello world examples of JMS I've seen, they are sending a small message using Sender and Receiver consumes this message.

But in the case of a Stored procedure call, I am wondering what exactly should be forwarded to ApacheMQ ? If I understood correctly, the Sender in this case would be sending the call to the stored procedure to JMS Queue in the form of a String, and then Receiver will grab this string message(which is a call to stored procedure) from the Queue immediately (provided I've only one item in the Queue) and Receiver will start processing it? So, by receiver processing I mean the receiver will communicate with the database and process the query. Is this how it works basically? Thanks

0

In short yes, the receiver has to interface with the DB to invoke the actual stored proc. From the point of calling the proc (payload to put on to the JMS queue), i would suggest pass on the bare minimum stuff to invoke the stored proc with parameters. The receiver from the JMS endpoint should know which stored proc to route to (do not expect the caller to provided it).

| improve this answer | |
  • Thanks. By any chance, you have any documentation where I can look something related to scheduling a stored procedure or a SQL? – John Feb 11 '19 at 23:56
  • @john can you accept the answer if that is what you were looking for. For scheduling there are many like Quartz (quartz-scheduler.org), spring has support for the same, corn scheduler if your running on Linux/Unix flavours or paid tools like auyosys. – Vishnu Feb 13 '19 at 16:37
  • Could you tell me what would be the flow for my asynchronous requests? I am still not very clear on this. Thanks – John Feb 15 '19 at 22:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.