Hello, I am rather new to Spring Batch Admin and I am quite happy with using Spring Batch for my task. However, I can't seem to configure my job to:
1. Register by Spring Batch Admin
2. Set job to be launchable by the GUI
3. Set the incrementer for the jobs.
To enable Spring Batch Admin, I followed the steps toCode:<job id="pdorderJob" parent="simpleJob" incrementer="incrementer"> <step id="convertToVendorOrderFormat" parent="simpleStep"> <tasklet> <chunk reader="orderDetailReader" processor="convertToVendorProcessor" writer="orderDetailWriter"/> </tasklet> </step> </job> <job id="orderStatus" parent="simpleJob" incrementer="incrementer"> <!-- 1. Use scheduler for order status --> <step id="queryOrderStatus" parent="simpleStep" next="confirmShipping"> <tasklet> <chunk reader="orderStatusSqlItemReader" processor="queryOrderStatusProcessor" writer="queryOrderStatusWriter"/> </tasklet> </step> <!-- 2. Query database for status = 7, and call confirm_shipping --> <step id="confirmShipping" parent="simpleStep"> <tasklet> <chunk reader="confirmShippingSqlItemReader" processor="confirmShippingProcessor" writer="queryOrderStatusWriter"/> <listeners> <listener ref="noWorkFoundStepExecutionListener"/> </listeners> </tasklet> <fail on="FAILED" exit-code="NOTHING SHIPPED"/> </step> </job> <beans:bean id="simpleJob" class="org.springframework.batch.core.job.SimpleJob" abstract="true"> <beans:property name="jobRepository" ref="jobRepository" /> <beans:property name="restartable" value="true" /> </beans:bean> <beans:bean id="simpleStep" class="org.springframework.batch.core.step.item.SimpleStepFactoryBean" abstract="true"> <beans:property name="transactionManager" ref="transactionManager" /> <beans:property name="jobRepository" ref="jobRepository" /> <beans:property name="startLimit" value="100" /> <beans:property name="commitInterval" value="1" /> </beans:bean> <beans:bean id="incrementer" class="com.pictage.provendirect.domain.order.internal.TrivialJobParametersIncrementer"/>
- Create a war project with an index.jsp and a web.xml (from the sample or from the spring-batch-admin-resources.jar).
- Include the spring-batch-admin-*.jar files in WEB-INF/lib. In the sample this is done simply by making the WAR depend on those jar files in the Maven pom.
- Optionally add your own jobs in the classpath under META-INF/spring/batch/jobs/*.xml.
I place the configuration file in src/main/resources/META-INF/batch/jobs/pdorderJob.xml
I copy the abstract SimpleJob, SimpleStep and TrivalJobParametersIncrementer from the Spring Batch Admin example with STS. And I researched on the configuration (module-context.xml) in the example. All three jobs, job1, job2, and infinite, are launchable and has Incrementable.
How do you configure jobs to be launchable and incrementable? My first job, pdorder show up under http://localhost:8080/spring-batch-simple/jobs, but not the second one, orderStatus, does not. And they are both inside the same xml file configuration, pdorderJob.xml Am I missing something?
I am using 1.2.0.RELEASE of Spring Batch Admin. Any help would be greatly appreciated. Thanks for such an awesome product.


Reply With Quote
