Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Invoke a seperate application from my Application server

 
Pratik Lohia
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Chetan Parekh
Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
(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.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

See if this Sun Tutorial gives you a good start on JMS.

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 ]
 
Pratik Lohia
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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....
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure what was not clear ...

JVM1 and JVM2 both connect to the same queue manager.

JVM1 puts a message on a queue, JVM2 gets it off the queue.

Try the JMS tutorials.
 
Pratik Lohia
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No... JVM1 does not put a message on the Queue and JVM2 gets it off the queue... This isn't wat i want

Collecting data is not a problem of any JVM... its a SAP system that does it..


Problem is
JVM1 calls JVM2 to create data from a database and JVM2 only then sends the data to the queue...

Hope I am more clear now!!!
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tell us more about your architecture. Are you using WebSphere Application Server? If so, it can be configured as a JMS provider and receive messages from JVM1.
 
Pratik Lohia
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I am using WAS 5.1 on a linux box
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since this question has a WS environment in mind I'll move it to that forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic