当前位置: 首页 > news >正文

成都网站建设方案推广一站式网站开发

成都网站建设方案推广,一站式网站开发,logo免费设计软件,深圳市力同科技有限公司许多企业应用程序需要批处理才能每天处理数十亿笔交易。 必须处理这些大事务集#xff0c;而不会出现性能问题。 Spring Batch是一个轻量级且强大的批处理框架#xff0c;用于处理这些大数据集。 Spring Batch提供了“面向TaskletStep”和“面向块”的处理风格。 在本文中而不会出现性能问题。 Spring Batch是一个轻量级且强大的批处理框架用于处理这些大数据集。 Spring Batch提供了“面向TaskletStep”和“面向块”的处理风格。 在本文中解释了面向TaskletStep的处理模型。 让我们研究基本的Spring Batch组件 职位 封装整个批处理过程的实体。 步骤和任务集在作业下定义 步 封装批处理作业的独立顺序阶段的域对象。 JobInstance 批处理域对象代表一个唯一可识别的作业运行-它的标识由Job和JobParameters对提供。 JobParameters 值对象代表批处理作业的运行时参数。 工作执行 JobExecution指的是一次尝试运行Job的技术概念。 执行可能以失败或成功结束但是与给定执行相对应的JobInstance不会被视为完成除非执行成功完成。 JobRepository 一个接口负责批处理元数据实体的持久性。 在以下示例中通过MapJobRepositoryFactoryBean使用内存中的存储库。 JobLauncher 公开运行方法的接口该方法启动并控制定义的作业。 TaskLet 暴露执行方法的接口该方法将被反复调用直到它返回RepeatStatus.FINISHED或引发异常以指示失败。 当以下示例不要求读者和作家时使用它。 让我们看一下如何开发面向Tasklet步骤的处理模型。 二手技术 JDK 1.7.0_09 Spring3.1.3 Spring批次2.1.9 Maven的3.0.4 步骤1建立已完成的专案 创建一个Maven项目如下所示。 可以使用Maven或IDE插件来创建它。 步骤2图书馆 首先将依赖项添加到Maven的pom.xml中。 propertiesspring.version3.1.3.RELEASE/spring.versionspring-batch.version2.1.9.RELEASE/spring-batch.version/propertiesdependencies!-- Spring Dependencies --dependencygroupIdorg.springframework/groupIdartifactIdspring-core/artifactIdversion${spring.version}/version/dependencydependencygroupIdorg.springframework/groupIdartifactIdspring-context/artifactIdversion${spring.version}/version/dependency !-- Spring Batch Dependency --dependencygroupIdorg.springframework.batch/groupIdartifactIdspring-batch-core/artifactIdversion${spring-batch.version}/version/dependency!-- Log4j library --dependencygroupIdlog4j/groupIdartifactIdlog4j/artifactIdversion1.2.16/version/dependency/dependencies maven-compiler-plugin Maven插件用于使用JDK 1.7编译项目 plugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-compiler-plugin/artifactIdversion3.0/versionconfigurationsource1.7/sourcetarget1.7/target/configuration/plugin 以下Maven插件可用于创建runnable-jar plugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-shade-plugin/artifactIdversion2.0/versionexecutionsexecutionphasepackage/phasegoalsgoalshade/goal/goalsconfigurationconfigurationsource1.7/sourcetarget1.7/target/configurationtransformerstransformerimplementationorg.apache.maven.plugins.shade.resource.ManifestResourceTransformermainClasscom.onlinetechvision.exe.Application/mainClass/transformertransformerimplementationorg.apache.maven.plugins.shade.resource.AppendingTransformerresourceMETA-INF/spring.handlers/resource/transformertransformerimplementationorg.apache.maven.plugins.shade.resource.AppendingTransformerresourceMETA-INF/spring.schemas/resource/transformer/transformers/configuration/execution/executions/plugin步骤3创建成功的StepTasklet任务表 通过实现Tasklet接口来创建SuccessStepTasklet。 它成功地说明了业务逻辑。 package com.onlinetechvision.tasklet;import org.apache.log4j.Logger; import org.springframework.batch.core.StepContribution; import org.springframework.batch.core.scope.context.ChunkContext; import org.springframework.batch.core.step.tasklet.Tasklet; import org.springframework.batch.repeat.RepeatStatus;/*** SuccessfulStepTasklet Class illustrates a successful job** author onlinetechvision.com* since 27 Nov 2012* version 1.0.0**/ public class SuccessfulStepTasklet implements Tasklet {private static final Logger logger Logger.getLogger(SuccessfulStepTasklet.class);private String taskResult;/*** Executes SuccessfulStepTasklet** param StepContribution stepContribution* param ChunkContext chunkContext* return RepeatStatus* throws Exception**/Overridepublic RepeatStatus execute(StepContribution stepContribution, ChunkContext chunkContext) throws Exception {logger.debug(Task Result : getTaskResult());return RepeatStatus.FINISHED;}public String getTaskResult() {return taskResult;}public void setTaskResult(String taskResult) {this.taskResult taskResult;} }步骤4创建失败的StepTasklet任务 通过实现Tasklet接口创建FailedStepTasklet。 它说明了失败步骤中的业务逻辑。 package com.onlinetechvision.tasklet;import org.apache.log4j.Logger; import org.springframework.batch.core.StepContribution; import org.springframework.batch.core.scope.context.ChunkContext; import org.springframework.batch.core.step.tasklet.Tasklet; import org.springframework.batch.repeat.RepeatStatus;/*** FailedStepTasklet Class illustrates a failed job.** author onlinetechvision.com* since 27 Nov 2012* version 1.0.0**/ public class FailedStepTasklet implements Tasklet {private static final Logger logger Logger.getLogger(FailedStepTasklet.class);private String taskResult;/*** Executes FailedStepTasklet** param StepContribution stepContribution* param ChunkContext chunkContext* return RepeatStatus* throws Exception**/Overridepublic RepeatStatus execute(StepContribution stepContribution, ChunkContext chunkContext) throws Exception {logger.debug(Task Result : getTaskResult());throw new Exception(Error occurred!);}public String getTaskResult() {return taskResult;}public void setTaskResult(String taskResult) {this.taskResult taskResult;} }步骤5创建BatchProcessStarter类 创建BatchProcessStarter类以启动作业。 此外它记录他们的执行结果。 无法使用相同的参数重新启动已完成的作业实例因为该作业实例已经存在于作业存储库中并且JobInstanceAlreadyCompleteException抛出并带有“作业实例已经存在且已完成”说明。 可以使用其他参数重新启动。 在以下示例中设置了不同的currentTime参数以重新启动FirstJob。 package com.onlinetechvision.spring.batch;import org.apache.log4j.Logger; import org.springframework.batch.core.Job; import org.springframework.batch.core.JobExecution; import org.springframework.batch.core.JobParametersBuilder; import org.springframework.batch.core.JobParametersInvalidException; import org.springframework.batch.core.launch.JobLauncher; import org.springframework.batch.core.repository.JobExecutionAlreadyRunningException; import org.springframework.batch.core.repository.JobInstanceAlreadyCompleteException; import org.springframework.batch.core.repository.JobRepository; import org.springframework.batch.core.repository.JobRestartException;/*** BatchProcessStarter Class launches the jobs and logs their execution results.** author onlinetechvision.com* since 27 Nov 2012* version 1.0.0**/ public class BatchProcessStarter {private static final Logger logger Logger.getLogger(BatchProcessStarter.class);private Job firstJob;private Job secondJob;private Job thirdJob;private JobLauncher jobLauncher;private JobRepository jobRepository;/*** Starts the jobs and logs their execution results.**/public void start() {JobExecution jobExecution null;JobParametersBuilder builder new JobParametersBuilder();try {builder.addLong(currentTime, new Long(System.currentTimeMillis()));getJobLauncher().run(getFirstJob(), builder.toJobParameters());jobExecution getJobRepository().getLastJobExecution(getFirstJob().getName(), builder.toJobParameters());logger.debug(jobExecution.toString()); getJobLauncher().run(getSecondJob(), builder.toJobParameters());jobExecution getJobRepository().getLastJobExecution(getSecondJob().getName(), builder.toJobParameters());logger.debug(jobExecution.toString());getJobLauncher().run(getThirdJob(), builder.toJobParameters());jobExecution getJobRepository().getLastJobExecution(getThirdJob().getName(), builder.toJobParameters());logger.debug(jobExecution.toString());builder.addLong(currentTime, new Long(System.currentTimeMillis()));getJobLauncher().run(getFirstJob(), builder.toJobParameters());jobExecution getJobRepository().getLastJobExecution(getFirstJob().getName(), builder.toJobParameters());logger.debug(jobExecution.toString());} catch (JobExecutionAlreadyRunningException| JobRestartException| JobInstanceAlreadyCompleteException| JobParametersInvalidException e) {logger.error(e);}} public Job getFirstJob() {return firstJob;}public void setFirstJob(Job firstJob) {this.firstJob firstJob;}public Job getSecondJob() {return secondJob;}public void setSecondJob(Job secondJob) {this.secondJob secondJob;} public Job getThirdJob() {return thirdJob;}public void setThirdJob(Job thirdJob) {this.thirdJob thirdJob;}public JobLauncher getJobLauncher() {return jobLauncher;}public void setJobLauncher(JobLauncher jobLauncher) {this.jobLauncher jobLauncher;}public JobRepository getJobRepository() {return jobRepository;}public void setJobRepository(JobRepository jobRepository) {this.jobRepository jobRepository;} }步骤6创建applicationContext.xml Spring配置文件applicationContext.xml已创建。 它涵盖了Tasklet和BatchProcessStarter定义。 ?xml version1.0 encodingUTF-8? beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:batchhttp://www.springframework.org/schema/batchxsi:schemaLocationhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsdhttp://www.springframework.org/schema/batchhttp://www.springframework.org/schema/batch/spring-batch-2.1.xsdbean idfirstTasklet classcom.onlinetechvision.tasklet.SuccessfulStepTaskletproperty nametaskResult valueFirst Task is executed... //beanbean idsecondTasklet classcom.onlinetechvision.tasklet.SuccessfulStepTaskletproperty nametaskResult valueSecond Task is executed... //beanbean idthirdTasklet classcom.onlinetechvision.tasklet.SuccessfulStepTaskletproperty nametaskResult valueThird Task is executed... //beanbean idfourthTasklet classcom.onlinetechvision.tasklet.SuccessfulStepTaskletproperty nametaskResult valueFourth Task is executed... //beanbean idfifthTasklet classcom.onlinetechvision.tasklet.SuccessfulStepTaskletproperty nametaskResult valueFifth Task is executed... //beanbean idsixthTasklet classcom.onlinetechvision.tasklet.SuccessfulStepTaskletproperty nametaskResult valueSixth Task is executed... //beanbean idseventhTasklet classcom.onlinetechvision.tasklet.SuccessfulStepTaskletproperty nametaskResult valueSeventh Task is executed... //beanbean idfailedStepTasklet classcom.onlinetechvision.tasklet.FailedStepTaskletproperty nametaskResult valueError occurred! //bean bean idbatchProcessStarter classcom.onlinetechvision.spring.batch.BatchProcessStarterproperty namejobLauncher refjobLauncher/property namejobRepository refjobRepository/property namefirstJob reffirstJob/property namesecondJob refsecondJob/property namethirdJob refthirdJob//bean /beans步骤7创建jobContext.xml Spring配置文件jobContext.xml已创建。 乔布斯的流程如下 FirstJob的流程 1开始第一步。 2FirstStep以COMPLETED状态完成后SecondStep开始。 3SecondStep以COMPLETED状态完成后将启动ThirdStep。 4在以COMPLETED状态完成ThirdStep之后以COMPLETED状态完成FirstJob执行。 SecondJob的流程 1第四步开始。 2在以COMPLETED状态完成第四步之后开始第五步。 3在完成状态为FifthStep之后以完成状态完成SecondJob执行。 ThirdJob的流程 1第六步开始。 2在完成状态为SixthStep之后将启动SeventhStep。 3在SeventhStep以FAILED状态完成后ThirdJob执行在FAILED状态下完成。 FirstJob的流程与第一次执行相同。 ?xml version1.0 encodingUTF-8? beans xmlnshttp://www.springframework.org/schema/beansxmlns:xsihttp://www.w3.org/2001/XMLSchema-instancexmlns:batchhttp://www.springframework.org/schema/batchxsi:schemaLocationhttp://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsdhttp://www.springframework.org/schema/batchhttp://www.springframework.org/schema/batch/spring-batch-2.1.xsdimport resourceapplicationContext.xml/bean idtransactionManager classorg.springframework.batch.support.transaction.ResourcelessTransactionManager/bean idjobRepository classorg.springframework.batch.core.repository.support.MapJobRepositoryFactoryBeanproperty nametransactionManager reftransactionManager //beanbean idjobLauncher classorg.springframework.batch.core.launch.support.SimpleJobLauncher property namejobRepository refjobRepository//beanbean idtaskletStep classorg.springframework.batch.core.step.tasklet.TaskletStepproperty namejobRepository refjobRepository/property nametransactionManager reftransactionManager//beanbatch:job idfirstJobbatch:step idfirstStep nextsecondStepbatch:tasklet reffirstTasklet//batch:stepbatch:step idsecondStep nextthirdStep batch:tasklet refsecondTasklet//batch:stepbatch:step idthirdStepbatch:tasklet refthirdTasklet //batch:step/batch:jobbatch:job idsecondJobbatch:step idfourthStepbatch:tasklet reffourthTasklet /batch:next on* tofifthStep /batch:next onFAILED tofailedStep //batch:stepbatch:step idfifthStepbatch:tasklet reffifthTasklet //batch:stepbatch:step idfailedStepbatch:tasklet reffailedStepTasklet //batch:step/batch:jobbatch:job idthirdJobbatch:step idsixthStepbatch:tasklet refsixthTasklet /batch:next on* toseventhStep /batch:next onFAILED toeighthStep //batch:stepbatch:step idseventhStepbatch:tasklet reffailedStepTasklet //batch:stepbatch:step ideighthStepbatch:tasklet refseventhTasklet //batch:step/batch:job/beans步骤8建立应用程式类别 创建应用程序类以运行应用程序。 package com.onlinetechvision.exe;import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext;import com.onlinetechvision.spring.batch.BatchProcessStarter;/*** Application Class starts the application.** author onlinetechvision.com* since 27 Nov 2012* version 1.0.0**/ public class Application {/*** Starts the application** param String[] args**/public static void main(String[] args) {ApplicationContext appContext new ClassPathXmlApplicationContext(jobContext.xml);BatchProcessStarter batchProcessStarter (BatchProcessStarter)appContext.getBean(batchProcessStarter);batchProcessStarter.start();}}步骤9建立专案 构建OTV_SpringBatch_TaskletStep_Oriented_Processing项目后将创建OTV_SpringBatch_TaskletStep-0.0.1-SNAPSHOT.jar 。 步骤10运行项目 运行创建的OTV_SpringBatch_TaskletStep-0.0.1-SNAPSHOT.jar文件后将显示以下控制台输出日志 First Job的控制台输出 25.11.2012 21:29:19 INFO (SimpleJobLauncher.java:118) - Job: [FlowJob: [namefirstJob]] launched with the following parameters: [{currentTime1353878959462}] 25.11.2012 21:29:19 DEBUG (AbstractJob.java:278) - Job execution starting: JobExecution: id0, version0, startTimenull, endTimenull, lastUpdatedSun Nov 25 21:29:19 GMT 2012, statusSTARTING, exitStatusexitCodeUNKNOWN; exitDescription, job[JobInstance: id0, version0, JobParameters[{currentTime1353878959462}], Job[firstJob]] 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:135) - Resuming statefirstJob.firstStep with statusUNKNOWN 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:143) - Handling statefirstJob.firstStep 25.11.2012 21:29:20 INFO (SimpleStepHandler.java:133) - Executing step: [firstStep] 25.11.2012 21:29:20 DEBUG (AbstractStep.java:180) - Executing: id1 25.11.2012 21:29:20 DEBUG (SuccessfulStepTasklet.java:33) - Task Result : First Task is executed... 25.11.2012 21:29:20 DEBUG (AbstractStep.java:209) - Step execution success: id1 25.11.2012 21:29:20 DEBUG (AbstractStep.java:273) - Step execution complete: StepExecution: id1, version3, namefirstStep, statusCOMPLETED, exitStatusCOMPLETED, readCount0, filterCount0, writeCount0 readSkipCount0, writeSkipCount0, processSkipCount0, commitCount1, rollbackCount0 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:156) - Completed statefirstJob.firstStep with statusCOMPLETED25.11.2012 21:29:20 DEBUG (SimpleFlow.java:143) - Handling statefirstJob.secondStep 25.11.2012 21:29:20 INFO (SimpleStepHandler.java:133) - Executing step: [secondStep] 25.11.2012 21:29:20 DEBUG (AbstractStep.java:180) - Executing: id2 25.11.2012 21:29:20 DEBUG (SuccessfulStepTasklet.java:33) - Task Result : Second Task is executed... 25.11.2012 21:29:20 DEBUG (AbstractStep.java:209) - Step execution success: id2 25.11.2012 21:29:20 DEBUG (AbstractStep.java:273) - Step execution complete: StepExecution: id2, version3, namesecondStep, statusCOMPLETED, exitStatusCOMPLETED, readCount0, filterCount0, writeCount0 readSkipCount0, writeSkipCount0, processSkipCount0, commitCount1, rollbackCount0 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:156) - Completed statefirstJob.secondStep with statusCOMPLETED 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:143) - Handling statefirstJob.thirdStep25.11.2012 21:29:20 INFO (SimpleStepHandler.java:133) - Executing step: [thirdStep] 25.11.2012 21:29:20 DEBUG (AbstractStep.java:180) - Executing: id3 25.11.2012 21:29:20 DEBUG (SuccessfulStepTasklet.java:33) - Task Result : Third Task is executed... 25.11.2012 21:29:20 DEBUG (AbstractStep.java:273) - Step execution complete: StepExecution: id3, version3, namethirdStep, statusCOMPLETED, exitStatusCOMPLETED, readCount0, filterCount0, writeCount0 readSkipCount0, writeSkipCount0, processSkipCount0, commitCount1, rollbackCount0 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:156) - Completed statefirstJob.thirdStep with statusCOMPLETED 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:143) - Handling statefirstJob.end3 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:156) - Completed statefirstJob.end3 with statusCOMPLETED 25.11.2012 21:29:20 DEBUG (AbstractJob.java:294) - Job execution complete: JobExecution: id0, version1, startTimeSun Nov 25 21:29:19 GMT 2012, endTimenull, lastUpdatedSun Nov 25 21:29:19 GMT 2012, statusCOMPLETED, exitStatusexitCodeCOMPLETED;exitDescription, job[JobInstance: id0, version0, JobParameters[{currentTime1353878959462}], Job[firstJob]] 25.11.2012 21:29:20 INFO (SimpleJobLauncher.java:121) - Job: [FlowJob: [namefirstJob]] completed with the following parameters: [{currentTime1353878959462}] and the following status: [COMPLETED] 25.11.2012 21:29:20 DEBUG (BatchProcessStarter.java:44) - JobExecution: id0, version2, startTimeSun Nov 25 21:29:19 GMT 2012, endTimeSun Nov 25 21:29:20 GMT 2012, lastUpdatedSun Nov 25 21:29:20 GMT 2012, statusCOMPLETED, exitStatusexitCodeCOMPLETED;exitDescription, job[JobInstance: id0, version0, JobParameters[{currentTime1353878959462}], Job[firstJob]] Second Job的控制台输出 25.11.2012 21:29:20 INFO (SimpleJobLauncher.java:118) - Job: [FlowJob: [namesecondJob]] launched with the following parameters: [{currentTime1353878959462}] 25.11.2012 21:29:20 DEBUG (AbstractJob.java:278) - Job execution starting: JobExecution: id1, version0, startTimenull, endTimenull, lastUpdatedSun Nov 25 21:29:20 GMT 2012, statusSTARTING, exitStatusexitCodeUNKNOWN;exitDescription, job[JobInstance: id1, version0, JobParameters[{currentTime1353878959462}], Job[secondJob]] 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:135) - Resuming statesecondJob.fourthStep with statusUNKNOWN 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:143) - Handling statesecondJob.fourthStep 25.11.2012 21:29:20 INFO (SimpleStepHandler.java:133) - Executing step: [fourthStep] 25.11.2012 21:29:20 DEBUG (AbstractStep.java:180) - Executing: id4 25.11.2012 21:29:20 DEBUG (SuccessfulStepTasklet.java:33) - Task Result : Fourth Task is executed... 25.11.2012 21:29:20 DEBUG (AbstractStep.java:273) - Step execution complete: StepExecution: id4, version3, namefourthStep, statusCOMPLETED, exitStatusCOMPLETED, readCount0, filterCount0, writeCount0 readSkipCount0, writeSkipCount0, processSkipCount0, commitCount1, rollbackCount0 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:156) - Completed statesecondJob.fourthStep with statusCOMPLETED25.11.2012 21:29:20 DEBUG (SimpleFlow.java:143) - Handling statesecondJob.fifthStep 25.11.2012 21:29:20 INFO (SimpleStepHandler.java:133) - Executing step: [fifthStep] 25.11.2012 21:29:20 DEBUG (AbstractStep.java:180) - Executing: id5 25.11.2012 21:29:20 DEBUG (SuccessfulStepTasklet.java:33) - Task Result : Fifth Task is executed... 25.11.2012 21:29:20 DEBUG (AbstractStep.java:273) - Step execution complete: StepExecution: id5, version3, namefifthStep, statusCOMPLETED, exitStatusCOMPLETED, readCount0, filterCount0, writeCount0 readSkipCount0, writeSkipCount0, processSkipCount0, commitCount1, rollbackCount0 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:156) - Completed statesecondJob.fifthStep with statusCOMPLETED 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:143) - Handling statesecondJob.end5 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:156) - Completed statesecondJob.end5 with statusCOMPLETED 25.11.2012 21:29:20 DEBUG (AbstractJob.java:294) - Job execution complete: JobExecution: id1, version1, startTimeSun Nov 25 21:29:20 GMT 2012, endTimenull, lastUpdatedSun Nov 25 21:29:20 GMT 2012, statusCOMPLETED, exitStatusexitCodeCOMPLETED;exitDescription, job[JobInstance: id1, version0, JobParameters[{currentTime1353878959462}], Job[secondJob]] 25.11.2012 21:29:20 INFO (SimpleJobLauncher.java:121) - Job: [FlowJob: [namesecondJob]] completed with the following parameters: [{currentTime1353878959462}] and the following status: [COMPLETED] 25.11.2012 21:29:20 DEBUG (BatchProcessStarter.java:48) - JobExecution: id1, version2, startTimeSun Nov 25 21:29:20 GMT 2012, endTimeSun Nov 25 21:29:20 GMT 2012, lastUpdatedSun Nov 25 21:29:20 GMT 2012, statusCOMPLETED, exitStatusexitCodeCOMPLETED;exitDescription, job[JobInstance: id1, version0, JobParameters[{currentTime1353878959462}], Job[secondJob]] Third Job的控制台输出 25.11.2012 21:29:20 INFO (SimpleJobLauncher.java:118) - Job: [FlowJob: [namethirdJob]] launched with the following parameters: [{currentTime1353878959462}] 25.11.2012 21:29:20 DEBUG (AbstractJob.java:278) - Job execution starting: JobExecution: id2, version0, startTimenull, endTimenull, lastUpdatedSun Nov 25 21:29:20 GMT 2012, statusSTARTING, exitStatusexitCodeUNKNOWN;exitDescription, job[JobInstance: id2, version0, JobParameters[{currentTime1353878959462}], Job[thirdJob]] 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:135) - Resuming statethirdJob.sixthStep with statusUNKNOWN 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:143) - Handling statethirdJob.sixthStep 25.11.2012 21:29:20 INFO (SimpleStepHandler.java:133) - Executing step: [sixthStep] 25.11.2012 21:29:20 DEBUG (AbstractStep.java:180) - Executing: id6 25.11.2012 21:29:20 DEBUG (SuccessfulStepTasklet.java:33) - Task Result : Sixth Task is executed... 25.11.2012 21:29:20 DEBUG (AbstractStep.java:273) - Step execution complete: StepExecution: id6, version3, namesixthStep, statusCOMPLETED, exitStatusCOMPLETED, readCount0, filterCount0, writeCount0 readSkipCount0, writeSkipCount0, processSkipCount0, commitCount1, rollbackCount0 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:156) - Completed statethirdJob.sixthStep with statusCOMPLETED25.11.2012 21:29:20 DEBUG (SimpleFlow.java:143) - Handling statethirdJob.seventhStep 25.11.2012 21:29:20 INFO (SimpleStepHandler.java:133) - Executing step: [seventhStep] 25.11.2012 21:29:20 DEBUG (AbstractStep.java:180) - Executing: id7 25.11.2012 21:29:20 DEBUG (FailedStepTasklet.java:33) - Task Result : Error occurred! 25.11.2012 21:29:20 DEBUG (TaskletStep.java:456) - Rollback for Exception: java.lang.Exception: Error occurred! 25.11.2012 21:29:20 DEBUG (TransactionTemplate.java:152) - Initiating transaction rollback on application exception...25.11.2012 21:29:20 DEBUG (AbstractPlatformTransactionManager.java:821) - Initiating transaction rollback 25.11.2012 21:29:20 DEBUG (ResourcelessTransactionManager.java:54) - Rolling back resourceless transaction on [org.springframework.batch.support.transaction.ResourcelessTransactionManager $ResourcelessTransaction40874c04] 25.11.2012 21:29:20 DEBUG (RepeatTemplate.java:291) - Handling exception: java.lang.Exception, caused by: java.lang.Exception: Error occurred! 25.11.2012 21:29:20 DEBUG (RepeatTemplate.java:251) - Handling fatal exception explicitly (rethrowing first of 1): java.lang.Exception: Error occurred! 25.11.2012 21:29:20 ERROR (AbstractStep.java:222) - Encountered an error executing the step...25.11.2012 21:29:20 DEBUG (ResourcelessTransactionManager.java:34) - Committing resourceless transaction on [org.springframework.batch.support.transaction.ResourcelessTransactionManager $ResourcelessTransaction66a7d863] 25.11.2012 21:29:20 DEBUG (AbstractStep.java:273) - Step execution complete: StepExecution: id7, version2, nameseventhStep, statusFAILED, exitStatusFAILED, readCount0, filterCount0, writeCount0 readSkipCount0, writeSkipCount0, processSkipCount0, commitCount0, rollbackCount1 25.11.2012 21:29:20 DEBUG (ResourcelessTransactionManager.java:34) - Committing resourceless transaction on [org.springframework.batch.support.transaction.ResourcelessTransactionManager $ResourcelessTransaction156f803c] 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:156) - Completed statethirdJob.seventhStep with statusFAILED 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:143) - Handling statethirdJob.fail8 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:156) - Completed statethirdJob.fail8 with statusFAILED 25.11.2012 21:29:20 DEBUG (AbstractJob.java:294) - Job execution complete: JobExecution: id2, version1, startTimeSun Nov 25 21:29:20 GMT 2012, endTimenull, lastUpdatedSun Nov 25 21:29:20 GMT 2012, statusFAILED, exitStatusexitCodeFAILED;exitDescription, job[JobInstance: id2, version0, JobParameters[{currentTime1353878959462}], Job[thirdJob]] 25.11.2012 21:29:20 INFO (SimpleJobLauncher.java:121) - Job: [FlowJob: [namethirdJob]] completed with the following parameters: [{currentTime1353878959462}] and the following status: [FAILED] 25.11.2012 21:29:20 DEBUG (BatchProcessStarter.java:52) - JobExecution: id2, version2, startTimeSun Nov 25 21:29:20 GMT 2012, endTimeSun Nov 25 21:29:20 GMT 2012, lastUpdatedSun Nov 25 21:29:20 GMT 2012, statusFAILED, exitStatusexitCodeFAILED; exitDescription, job[JobInstance: id2, version0, JobParameters[{currentTime1353878959462}], Job[thirdJob]] 重新启动后First Job的控制台输出 25.11.2012 21:29:20 INFO (SimpleJobLauncher.java:118) - Job: [FlowJob: [namefirstJob]] launched with the following parameters: [{currentTime1353878960660}] 25.11.2012 21:29:20 DEBUG (AbstractJob.java:278) - Job execution starting: JobExecution: id3, version0, startTimenull, endTimenull, lastUpdatedSun Nov 25 21:29:20 GMT 2012, statusSTARTING, exitStatusexitCodeUNKNOWN;exitDescription, job[JobInstance: id3, version0, JobParameters[{currentTime1353878960660}], Job[firstJob]] 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:135) - Resuming statefirstJob.firstStep with statusUNKNOWN 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:143) - Handling statefirstJob.firstStep 25.11.2012 21:29:20 INFO (SimpleStepHandler.java:133) - Executing step: [firstStep] 25.11.2012 21:29:20 DEBUG (AbstractStep.java:180) - Executing: id8 25.11.2012 21:29:20 DEBUG (SuccessfulStepTasklet.java:33) - Task Result : First Task is executed... 25.11.2012 21:29:20 DEBUG (AbstractStep.java:209) - Step execution success: id8 25.11.2012 21:29:20 DEBUG (AbstractStep.java:273) - Step execution complete: StepExecution: id8, version3, namefirstStep, statusCOMPLETED, exitStatusCOMPLETED, readCount0, filterCount0, writeCount0 readSkipCount0, writeSkipCount0, processSkipCount0, commitCount1, rollbackCount0 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:156) - Completed statefirstJob.firstStep with statusCOMPLETED25.11.2012 21:29:20 DEBUG (SimpleFlow.java:143) - Handling statefirstJob.secondStep 25.11.2012 21:29:20 INFO (SimpleStepHandler.java:133) - Executing step: [secondStep] 25.11.2012 21:29:20 DEBUG (AbstractStep.java:180) - Executing: id9 25.11.2012 21:29:20 DEBUG (SuccessfulStepTasklet.java:33) - Task Result : Second Task is executed... 25.11.2012 21:29:20 DEBUG (TaskletStep.java:417) - Applying contribution: [StepContribution: read0, written0, filtered0, readSkips0, writeSkips0, processSkips0, exitStatusEXECUTING] 25.11.2012 21:29:20 DEBUG (AbstractStep.java:209) - Step execution success: id9 25.11.2012 21:29:20 DEBUG (AbstractStep.java:273) - Step execution complete: StepExecution: id9, version3, namesecondStep, statusCOMPLETED, exitStatusCOMPLETED, readCount0, filterCount0, writeCount0 readSkipCount0, writeSkipCount0, processSkipCount0, commitCount1, rollbackCount0 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:156) - Completed statefirstJob.secondStep with statusCOMPLETED25.11.2012 21:29:20 DEBUG (SimpleFlow.java:143) - Handling statefirstJob.thirdStep 25.11.2012 21:29:20 INFO (SimpleStepHandler.java:133) - Executing step: [thirdStep] 25.11.2012 21:29:20 DEBUG (AbstractStep.java:180) - Executing: id10 25.11.2012 21:29:20 DEBUG (SuccessfulStepTasklet.java:33) - Task Result : Third Task is executed... 25.11.2012 21:29:20 DEBUG (TaskletStep.java:417) - Applying contribution: [StepContribution: read0, written0, filtered0, readSkips0, writeSkips0, processSkips0, exitStatusEXECUTING] 25.11.2012 21:29:20 DEBUG (AbstractStep.java:209) - Step execution success: id10 25.11.2012 21:29:20 DEBUG (AbstractStep.java:273) - Step execution complete: StepExecution: id10, version3, namethirdStep, statusCOMPLETED, exitStatusCOMPLETED, readCount0, filterCount0, writeCount0 readSkipCount0, writeSkipCount0, processSkipCount0, commitCount1, rollbackCount0 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:156) - Completed statefirstJob.thirdStep with statusCOMPLETED 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:143) - Handling statefirstJob.end3 25.11.2012 21:29:20 DEBUG (SimpleFlow.java:156) - Completed statefirstJob.end3 with statusCOMPLETED 25.11.2012 21:29:20 DEBUG (AbstractJob.java:294) - Job execution complete: JobExecution: id3, version1, startTimeSun Nov 25 21:29:20 GMT 2012, endTimenull, lastUpdatedSun Nov 25 21:29:20 GMT 2012, statusCOMPLETED, exitStatusexitCodeCOMPLETED;exitDescription, job[JobInstance: id3, version0, JobParameters[{currentTime1353878960660}], Job[firstJob]] 25.11.2012 21:29:20 INFO (SimpleJobLauncher.java:121) - Job: [FlowJob: [namefirstJob]] completed with the following parameters: [{currentTime1353878960660}] and the following status: [COMPLETED] 25.11.2012 21:29:20 DEBUG (BatchProcessStarter.java:57) - JobExecution: id3, version2, startTimeSun Nov 25 21:29:20 GMT 2012, endTimeSun Nov 25 21:29:20 GMT 2012, lastUpdatedSun Nov 25 21:29:20 GMT 2012, statusCOMPLETED, exitStatusexitCodeCOMPLETED;exitDescription, job[JobInstance: id3, version0, JobParameters[{currentTime1353878960660}], Job[firstJob]]步骤11下载 https://github.com/erenavsarogullari/OTV_SpringBatch_TaskletStep 相关链接 Spring Batch –参考文档 Spring Batch – API文档 参考 Online Technology Vision博客上的JCG合作伙伴 Eren Avsarogullari提供的Spring Batch中面向TaskletStep的处理 。 翻译自: https://www.javacodegeeks.com/2012/12/taskletstep-oriented-processing-in-spring-batch.html
http://www.huolong8.cn/news/381933/

相关文章:

  • 格尔木网站建设公司单位门户网站建设
  • phpcms 网站标题做婚介网站可行性报告
  • 瓷器网站源码wordpress get_page_link
  • 网站嵌入英文地图怀化营销策划网络推广渠道
  • 网站建设站网店推广的作用有哪些
  • 门户网站系统建设招标文件短视频推广app
  • 阳江市做网站郑州seo顾问外包
  • 网站建设外包行业班级网站的规划与建设
  • 自助式网站制作网站建设服务费属于什么费用
  • 做网站的最终目的北海网站建设公司
  • 手机网站可以做百度商桥吗广州app开发
  • 网站建设网络公司wordpress 背景特效插件
  • 一个好的网站需要具备什么苏州新闻
  • 装饰网站腾讯云网站搭建
  • 建设网站需要什么技术支持浏览器下载WordPress文件
  • 表白网页在线生成网站源码怎么进入wordpress的后台
  • 漳州专业做网站域名申请了怎么做网站
  • 昆山花桥做网站外贸论坛找客户
  • 放射科网站建设广东省东莞市建设培训中心网站
  • 装修设计公司起名南昌seo网站推广费用
  • 北京建筑公司排名外贸网站建设和seo
  • 网站开发招聘信息特色个人网页设计
  • 京东网站网站建设是什么创意品牌型网站
  • 境外网站 icp备案附近找装修公司
  • 网站推广服务商珠海网站建设制作
  • 基木鱼建站教程模板网站建设报价
  • 主题网站建设wordpress 图像相册
  • 管理咨询的主体包括哪些杭州网络排名优化
  • html静态网站模板下载WordPress离线编写
  • 高平企业网站平台网站怎么推广