Run Spring Batch job on grids - Proactive Scheduling Partition Handler
I have written a Partition Handler in order to execute a spring batch job on an infrastructure managed by the ProActive Scheduler.
The solution consists in 2 java classes :
- the partition handler itself - it creates a ProActive Scheduling job, iterates over the step executions provided by a step execution splitter and creates a (proactive) task for each step execution. The job execution id, step execution id, step name and the spring job configuration file name are passed to the task
- a java class that implements the execution on the remote node: StepExecutable which gathers an ApplicationContext which willl provide the corresponding step execution and step to be executed.
As what I see, there are 3 limitations in my approach:
- I neeed a job repository accessible from the remote nodes (I use a mysql database). I think is the same problem Antony described in his post http://forum.springsource.org/showth...highlight=grid
- I did not manage to obtain, in my partition handler, the name of the xml file which defines the spring job (this reference need to be sent to the remote nodes in order for the corresponding step to be found and executed). But I think this can be done, It's just that I'm not experienced with spring
- The last limitation, still related to the xml file describing the spring job, is that this file need to be accessible on the remote nodes. I hope that in the next version of the Scheduling we'll be able to transfer this automatically.
Otherwise my first test is working just fine. I put a post on the Proactive blog with details about this experience:
I'll put here my code, just in case someone is curios :)
(see my first comment, cannot paste it here, "message too long" :) )
Well, that's it. Any comments, opinions are welcomed.