Working with Spring Batch

Next-Level Spring: Developing Spring Batch Applications; Define, Manage and Test Batch Jobs & More

TT3356

Intermediate

2 Days

Course Overview

Batch processing is the processing of Jobs (transactions) in groups or batches. Jobs that can run with a minimum of end user interaction and can be scheduled to run when resources permit.  Spring Batch is a lightweight framework enabling the development of robust batch applications using the Spring Framework. Spring Batch the advanced technical services and features to support extremely high volume and high-performance batch jobs while utilizing the POJO-based development approach of the Spring Framework, familiar to all experienced Spring developers.

Working with Spring Batch is a two-day, fast-paced coding course geared for experienced developers who have prior working knowledge of Spring and Spring Boot.

Course Objectives

Working in a hands-on learning environment, students will explore the Spring framework, with emphasis placed on Spring Batch. Throughout the course students will:

  • Understand how to leverage the power of Spring Boot to develop Spring Batch applications
  • Use Spring Batch to define batch jobs
  • Define the batch workflow
  • Understand how Spring Batch manages the state of each job
  • Restart Jobs in case of failures during execution
  • Schedule Batch Jobs
  • Use Spring Cloud Data flow to monitor the batch jobs
  • Test the implementation of the Batch process
  • Test the implementation of individual steps of a Batch Job

Need different skills or topics?  If your team requires different topics or tools, additional skills or custom approach, this course may be further adjusted to accommodate.  We offer additional Spring, Java / JEE programming, Microservices / Services, REST, TDD / testing, design, application security and other related topics that may be blended with this course for a track that best suits your needs. Our team will collaborate with you to understand your needs and will target the course to focus on your specific learning objectives and goals.

Course Prerequisites

This in an intermediate-level Java development course geared for students experienced with Java and Spring programming essentials.  This course does not cover Java or Spring development basics.

Please see the Related Courses tab for specific Pre-Requisite courses, Related Courses that offer similar skills or topics, and next-step Learning Path recommendations.

Course Agenda

Please note that this list of topics is based on our standard course offering, evolved from typical industry uses and trends. We’ll work with you to tune this course and level of coverage to target the skills you need most.

Session: Spring Batch

Lesson: Introduction to Spring Batch

  • Introduction to Batch Processing
  • Requirements of Batch processes
  • JSR 352 and Spring Batch
  • Reader, Writer and Processor interfaces
  • Workflow basics
  • Spring Batch configuration
  • Domain Language of Batch

Lesson: Batch Jobs

  • Configuring the Spring Batch runtime (@EnableBatchProcessing)
  • Introduce the JobBuilderFactory and StepBuilderFactory
  • Overview of Tasklets
  • Launching a Job Running Jobs from the commandline
  • Lab: Introduction to Spring Batch
  • Lab: Running Jobs from the Command line

Lesson: Bootstrapping Spring Batch

  • Bootstrapping using Spring Boot
  • @EnableBatchProcessing
  • Configuring the Batch runtime: BatchConfigurer
  • Adding jobs to a registry
  • JobOperator
  • JobScope and StepScope
  • JobParametersValidator
  • Running jobs in a web environment, the asynchronous TaskExecutor
  • Modular configurations
  • Lab: Spring Batch Boot

Lesson: Readers and Writers

  • Chunks vs Tasklet
  • ItemReader, Processor and Writer
  • Exploring the Chunk size
  • FlatFileItemReader / FlatFileItemWriter
  • Working with XML and JSON
  • Processing data stored in relational databases
  • Using Spring Data JPA for ItemReader and ItemWriter
  • Lab: Spring Batch Steps
  • Lab: Spring Batch Processing

Lesson: Chunk Oriented Processing

  • Retry and Skip Logic
  • SkipPolicy
  • RetryPolicy and RetryContext
  • Configuring Steps
  • Defining Job flows
  • Implementing event listeners
  • Listener annotations
  • Lab: Spring Batch Chunks

Lesson: Scheduling Jobs

  • Introduction to Spring Batch scheduling
  • Scheduling Jobs from command line
  • Scheduling Jobs using Spring Scheduler
  • Scheduling Jobs using Quartz
  • Lab: Spring Batch Scheduling

Lesson: Spring Cloud Data Flow

  • Introduction to Spring Cloud Data Flow
  • Spring Cloud Task
  • Running the DataFlow Server
  • The @EnableTask Annotation
  • Registering the task with the server
  • Lab: Spring DataFlow Server

Lesson: Batch Unit Testing

  • Using JUnit 5 to test Spring Batch Jobs
  • The Spring TestContext (@SpringBootTest)
  • Integration testing
  • Defining DataSource for test
  • Populating the DataSource for test
  • @SpringBatchTest
  • Testing individual steps
  • Testing Step-Scoped Components
  • Lab: Spring Batch Test

Course Materials

Student Materials: Each participant will receive a digital Student Guide and/or Course Notes, code samples, software tutorials, step-by-step written lab instructions (as applicable), diagrams and related reference materials and resource links. Students will also receive the project files (or code, if applicable) and solutions required for the hands-on work.

Hands-On Setup Made Simple! Our dedicated tech team will work with you to ensure our ‘easy-access’ cloud-based course environment, or local installation, is accessible, fully-tested and verified as ready to go well in advance of the course start date, ensuring a smooth start to class and effective learning experience for all participants. In some cases we can also help you install this course locally if preferred. Please inquire for details and options.

Every-Course Extras = High-Value & Long-Term Learning Support! All Public Schedule courses include our unique EveryCourse Extras package (Course Recordings, Live Instructor Follow-on Support, Free *Live* Course Refresh Re-Takes, early access to Special Offers, Free Courses & more). Please inquire for details.

Raise the bar for advancing technology skills

Attend a Class!

Live scheduled classes are listed below or browse our full course catalog anytime

Special Offers

We regulary offer discounts for individuals, groups and corporate teams. Contact us

Custom Team Training

Check out custom training solutions planned around your unique needs and skills.

EveryCourse Extras

Exclusive materials, ongoing support and a free live course refresh with every class.

Mix, Match & Master!
2FOR1: Two Courses, One Price!

Enroll in *any* two public courses (for 2023 *OR* 2024 dates!) by December 31, for one price!  Learn something new, or share the promo!

Click for Details & Additional Offers

Learn. Explore. Advance!

Extend your training investment! Recorded sessions, free re-sits and after course support included with Every Course
Trivera MiniCamps
Gain the skills you need with less time in the classroom with our short course, live-online hands-on events
Trivera QuickSkills: Free Courses and Webinars
Training on us! Keep your skills current with free live events, courses & webinars
Trivera AfterCourse: Coaching and Support
Expert level after-training support to help organizations put new training skills into practice on the job

The voices of our customers speak volumes

Special Offers
Limited Offer for most courses.

SAVE 50%

Learn More