我用下面的任務啓動器啓動我的春天批處理作業:廣東話配置Spring Batch的運行作業因此
<bean id="jobLauncher" class="org.springframework.batch.core.launch.support.SimpleJobLauncher">
<property name="jobRepository" ref="jobRepository"/>
<property name="taskExecutor">
<bean class="org.springframework.core.task.SimpleAsyncTaskExecutor"/>
</property>
</bean>
和我的工作定義是
<job id="bulkExportJob" restartable="false" xmlns="http://www.springframework.org/schema/batch">
<description>Exports an application to pdf in a bulk operation</description>
<step id="startExport" next="exportFileTree">
<description>Do something to start the export</description>
<tasklet ref="startBulkActionTasklet"/>
</step>
<step id="exportFileTree" next="zipFileTree">
<description>Export the application</description>
<tasklet>
<chunk reader="bulkActionTargetReader" writer="bulkExportFileTreeWriter" commit-interval="1" skip-limit="100000000">
<skippable-exception-classes>
<!-- Exceptions are handled internally to the Writer so exception should not be treated as failures -->
<include class="java.lang.Exception"/>
</skippable-exception-classes>
</chunk>
</tasklet>
<listeners>
<listener ref="promotionListener"/>
</listeners>
</step>
<step id="zipFileTree" next="sendEmail">
<description>Creates a zip file</description>
<tasklet ref="bulkExportZipWriter"/>
</step>
<step id="sendEmail" next="finishExport">
<description>Send notification email</description>
<tasklet ref="bulkExportSendNotification"/>
</step>
<step id="finishExport">
<description>Finalise the export</description>
<tasklet ref="finishBulkActionTasklet"/>
</step>
</job>
我的目的是運行一個作業一次排隊所有其他傳入作業。但是從日誌文件中我可以看到所有作業都並行運行。正如你從代碼片段中看到的,我沒有任何額外的代碼來並行執行spring批處理,但它仍然有效。你能指點我做錯了什麼嗎?