PDA

View Full Version : Missing QuartzBatchJobLauncher


xml2008
Aug 19th, 2007, 04:34 AM
When I am running the Quartz sample, the class com.accenture.adsj.refapp.batch.launch.QuartzBatch JobLauncher can not be found in the released code base.


<bean id="tradeLauncher"
class="org.springframework.scheduling.quartz.JobDetailBea n">
<property name="jobClass" value="com.accenture.adsj.refapp.batch.launch.QuartzBatch JobLauncher" />
<property name="jobDataAsMap">
<map>
<entry key="batchRoot" value="src/main/resources/testBatchRoot" />
<entry key="hostName" value="localhost" />
<entry key="jobName" value="tradeJob" />
<entry key="jobStream" value="testStream" />
<entry key="userName" value="robert.kasanicky" />
<entry key="jobRun" value="1" />
</map>
</property>
</bean>

Dave Syer
Aug 19th, 2007, 10:23 AM
I think that was an old sample that shouldn't have been included. There is no failed unit test, so there must be an old xml file in there that needs to be weeded out. I'll nuke it and ask around to see if it actually ever had any value (I've never seen it).

sotretus
Aug 29th, 2007, 09:53 AM
I think that was an old sample that shouldn't have been included. There is no failed unit test, so there must be an old xml file in there that needs to be weeded out. I'll nuke it and ask around to see if it actually ever had any value (I've never seen it).


Dave, we are actually using that class that we got from a previous release and then it was gone. Still, it is really useful (and rather standard) so I think it should be added as part of the core spring batch, more if we want to take into account things like the threads hung in the TaskExecutor (see my other post).

We also extended this class to be able to run a single job. We think that besides the scheduler, there are some times where an operator might want to go for a "single-run" right now, and that was not possible. Maybe this could be a good add-on as well?

Regards
AB

Dave Syer
Aug 29th, 2007, 11:37 AM
Can you create an issue on JIRA an attach said Launcher and we can see if it will be easy to integrate (clearly it is old, judging by the package name)?

Running a single job "on demand" is probably going to be quite common. There are various features to support that scenario - the simplest of which is the BatchCommandLineLauncher. There is also a JMX-oriented demo / sample in adhocLoopJob.xml.

If you need more features in this area, or more support from the features that are there, we would be more than happy to consider concrete suggestions. Please post again, or craete some issues in JIRA.

sotretus
Aug 29th, 2007, 11:49 AM
Oh yeah, we didn't see that class. It is probably a better approach. We are using the same class in order to simplify the way the batch is started (currently we can run our batch with:

java -jar my-batch.jar


and that is something we would like to keep. (there can only be defined one Main class in the manifest.mf file, right?)

so to start a one-time job we are doing

java -DfastRun=true -DjobName=someJob -jar -my-batch.jar


(We are forcing the op. to add two parameters just for possible extensibility in the future).