1. In my application say 'A1', the user will fire a request to send data to MQ. There is a possibility the user will log out after that.
2. Now, the amount of data that needs to be processed and sent to MQ is very large and this might take a few hours. So, this processing of data and sending to MQ needs to be done on a seperate application, which cannot be run on the same server on which my application A1 is running(to avoid overloading the server).
3. My concern here is, how will I invoke this seperate(Send to MQ) application from my application A1 whenever the user would want to trigger sending data to MQ from the application A1.
(1)I don�t think it is right, if user can start any process and before process completes, he can logout. What if that process has some error? How will the user come to know about it? Check your requirement has this concerns or not?
(2) See if you can break your data in to small chunk and process it batch wise.
(3) If at all you want to do this, call external .bat /.sh/.exe file from your code that deal with MQ.
JMS is the Java API for queuing systems like MQ-Series. You can also use the MQ APIs from IBM, but they're not as simple and they're bound to one queuing product. Either way, it's a pretty simple matter to put a message on a queue in a "fire and forget" mode. Your app can put a message on queue and return a page to the user immediately that says "I put the work on a queue and application B will do it whenever it gets around to it."
The other application on another server can pull messages from the queue and process them at its own pace. Depending on what container the other application is running in (EJB? POJO?) you can probably tell it how many queue listeners (threads) to devote to incoming messages.
BTW: It sounds as though your user isn't real interested in waiting around for the results. Do you need a mechanism to notify somebody when the task is done or to report errors? [ December 27, 2005: Message edited by: Stan James ]
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Alright, Everybody is telling me that there needs to be a mechanism that the user should wait and be reported for errors.
I would clarify a couple of things.
All the data that will be send, will be pre-verified by the application itself for integrity. There will be no further validation of the data. What my other application does, is primarily create xml files of this data and put that in MQ. Now this other application too is tried and tested for any kind of failures. If failures occur, they will be primarily due to unforeseen circumstances like power outage in the middle of the application sending data or any such weird one off things, which the user need not really be notified about.
My Question still remains....
I need to invoke this other application on a different JVM... Any pointers....
So, how about JVM1 sending a JMS message which is processed by WAS's JMS server. WAS will provide a message listener (can be a MDB if you want) to process the message. The listener's onMessage() method can invoke existing JVM2 methods to read the DB and create the data.