Apr 3rd, 2008, 12:10 PM
Launch Job from Container triggered by scheduler
We have a use case to run Spring Batch jobs in Websphere container. I do not know the best practice to make it happen. Our data centre is using control-M and you can assume the scheduler will call a pre-defined shell script (e.g. runXXxJob.sh GenerateReportJob) when the scheduled time is arrived.
Specifically, my question is:
- how a shell script command trigger the start of a Spring Batch job retained inside the container?
Apr 3rd, 2008, 01:00 PM
In the past(Pre-Spring Batch) I have done this by having the script invoke an Application Client, which then kicks off the job as an EJB call, similar to what you see in the following sun article:
I have also worked with clients that have done something similar using JMX to invoke the batch job as well.
Apr 3rd, 2008, 09:46 PM
Thanks to your reply. In such a way, I think we can also implement similar by using MDB or Web-Service approach.
But we have one problem, how to make our application client blocking until the job finished (or stopped / interrupted)? We want to make the client behavior like a traditional command line program, which is blocking until the job finished.
Apr 4th, 2008, 02:33 AM
Seems like your client has to do the blocking. You could write your own code to poll a queue or web service for the result. Spring Integration also has some useful stuff (check out RequestReplyTemplate).