May 14th, 2008, 05:41 AM
Is JobExecution serializable?
The short query is as titled. The background is as follow.
We are exploring to launch a job remotely (or inside container). The strategy we are thinking is to implement a job launcher and injected into CommandLineJobRunner.
JobExecution jobExecution = launcher.run(job, jobParameters);
return exitCodeMapper.intValue(jobExecution.getExitStatus ()
In our JobLauncher:
send a message to container
container's MDB launch a job by SimpleJobLauncher (like the ordinary job launching)
MDB wait until the job completed and collect the status
MDB serialize the returned JobExecution object to a message to reply to requesting client.
To make this strategy perfect, it requires JobExecution is Serializable. Although, we can accept to return only 'useful' parameters (or only serializable params). Right now we can see only ExitStatus is required, for the use of ExitCodeMapper.
How do you comment this startegy?
May 14th, 2008, 06:02 AM
The simple answer is yes. JobExecution is Serializable and your outlined usecase looks OK at glance. If I remember correctly there were people on the forum using messaging to launch batch jobs in the past, so I suppose it works fine.