File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes Invoke a seperate application from my Application server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Websphere
Bookmark "Invoke a seperate application from my Application server" Watch "Invoke a seperate application from my Application server" New topic
Author

Invoke a seperate application from my Application server

Pratik Lohia
Ranch Hand

Joined: May 05, 2005
Posts: 88
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

Joined: Sep 16, 2004
Posts: 3636
(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.


My blood is tested +ve for Java.
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
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 ]

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
Pratik Lohia
Ranch Hand

Joined: May 05, 2005
Posts: 88
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

Joined: Jan 29, 2003
Posts: 8791
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

Joined: May 05, 2005
Posts: 88
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

Joined: Sep 29, 2002
Posts: 1683
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.


SCJP 1.4, SCWCD 1.3, SCBCD 1.3
Pratik Lohia
Ranch Hand

Joined: May 05, 2005
Posts: 88
Yes I am using WAS 5.1 on a linux box
Roger Chung-Wee
Ranch Hand

Joined: Sep 29, 2002
Posts: 1683
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

Joined: Oct 25, 2000
Posts: 7292

Since this question has a WS environment in mind I'll move it to that forum.


Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Invoke a seperate application from my Application server