Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get started with Spring Batch? [closed]

Tags:

spring-batch

I'm trying to learn Spring Batch, but the startup guide is very confusing. Comments like

You can get a pretty good idea about how to set up a job by examining the unit tests in the org.springframework.batch.sample package (in src/main/java) and the configuration in src/main/resources/jobs.

aren't exactly helpful. Also I find the Sample project very complicated (17 non-empty Namespaces with 109 classes)! Is there a simpler place to get started with Spring Batch?

like image 823
C. Ross Avatar asked Oct 22 '09 20:10

C. Ross


People also ask

How do you trigger a Spring Batch job?

Use a class SpringBatchScheduler to configure the scheduling of Spring Batch Jobs. A method called launchJob() will be registered as a scheduled task. To trigger the scheduled Spring Batch job, add the conditional flag for firing the job only when the flag is set to true (using the below code).

What happens if a step fails in Spring Batch?

if Step aStep fails for job someJob ( aStep has thrown some SQLException ). Then someJob is continued to execute. But after successful completion of cStep , BATCH_STATUS for someJob is COMPLETED but EXIT_STATUS = FAILED . Also BATCH_STATUS and EXIT_STATUS of other steps are as follows.

What is the entry point to launch Spring Batch jobs?

Because the script launching the job must kick off a Java Virtual Machine, there needs to be a class with a main method to act as the primary entry point. Spring Batch provides an implementation that serves just this purpose: CommandLineJobRunner .


1 Answers

A few pointers:

  • Spring Batch HelloWorld
  • Spring Batch "Hello World" 1
  • Spring Batch "Hello World" 2
  • A first look at Spring Batch (via archive.org)
  • A first look at Spring Batch, part 2 (via archive.org)
  • Spring Batch : Hello World!
like image 144
Pascal Thivent Avatar answered Sep 28 '22 23:09

Pascal Thivent