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

asked Feb 11, 2019 at 21:10

1 Answer 1

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).

answered Feb 11, 2019 at 21:21
3
  • Thanks. By any chance, you have any documentation where I can look something related to scheduling a stored procedure or a SQL? Commented Feb 11, 2019 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. Commented Feb 13, 2019 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 Commented Feb 15, 2019 at 22:49

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.