Apress Access

Pro Spring Batch

By Michael Minella

  • eBook Price: $38.99
Buy eBook Buy Print Book
Pro Spring Batch is your guide to learning and using Spring framework for batch processes—critical to most enterprise applications.

Full Description

  • Add to Wishlist
  • ISBN13: 978-1-4302-3452-4
  • 504 Pages
  • User Level: Intermediate to Advanced
  • Publication Date: July 17, 2011
  • Available eBook Formats: EPUB, MOBI, PDF

Related Titles

  • Go Recipes
  • Spring Persistence with Hibernate, Second Edition
  • Pro Spring Boot
  • Beginning Hibernate, 4th Edition
  • Reactive Java Programming
Full Description

Since its release, Spring Framework has transformed virtually every aspect of Java development including web applications, security, aspect-oriented programming, persistence, and messaging. Spring Batch, one of its newer additions, now brings the same familiar Spring idioms to batch processing. Spring Batch addresses the needs of any batch process, from the complex calculations performed in the biggest financial institutions to simple data migrations that occur with many software development projects.

Pro Spring Batch is intended to answer three questions:

  • What? What is batch processing? What does it entail? What makes it different from the other applications we are developing? What are the challenges inherent in the development of a batch process?
  • Why? Why do batch processing? Why can’t we just process things as we get them? Why do we do batch processing differently than the web applications that we currently work on?
  • How? How to implement a robust, scalable, distributed batch processing system using open-source frameworks

Pro Spring Batch gives concrete examples of how each piece of functionality is used and why it would be used in a real-world application. This includes providing tips that the "school of hard knocks" has taught author Michael Minella during his experience with Spring Batch. Pro Spring Batch includes examples of I/O options that are not mentioned in the official user’s guide, as well as performance tips on things like how to limit the impact of maintaining the state of your jobs.

The author also walks you through, from end to end, the design and implementation of a batch process based upon a theoretical real-world example. This includes basic project setup, implementation, testing, tuning and scaling for large volumes.

What you’ll learn

  • Batch concepts and how they relate to the Spring Batch framework
  • How to use declarative I/O using the Spring Batch readers/writers
  • Data integrity techniques used by Spring Batch, including transactions and job state/restartability
  • How to scale batch jobs via distributed batch processing
  • How to handle testing batch processes (Unit and functional)

Who this book is for

  • Java developers with Spring experience.
  • Java Architects designing batch solutions
More specifically, this book is intended for those who have a solid foundation in the core Java platform. Batch processing covers a wide spectrum of topics, not all of which are covered in detail in this book. Concepts in Java which the reader should be comfortable with include file I/O, JDBC, and transactions. Given that Spring Batch is a framework built upon the open-source IoC container Spring, which will not be covered in this book, it is expected that the reader will be familiar with its concepts and conventions. With that in mind, the reader is not expected to have any prior exposure to the Spring Batch framework. All concepts related to it will be explained in detail, with working examples.

Table of Contents

Table of Contents

  1. Batch and Spring
  2. Spring Batch 101
  3. Sample Job
  4. Understanding Jobs and Steps
  5. Job Repository and Metadata
  6. Running a Job
  7. Readers
  8. Item Processors
  9. Item Writers
  10. Sample Application
  11. Scaling and Tuning
  12. Testing Batch Processes
Source Code/Downloads

Downloads are available to accompany this book.

Your operating system can likely extract zipped downloads automatically, but you may require software such as WinZip for PC, or StuffIt on a Mac.


If you think that you've found an error in this book, please let us know by emailing to editorial@apress.com . You will find any confirmed erratum below, so you can check if your concern has already been addressed.

On page 9:
The PDF edition does not show the image for Figure 1-4. I'm using Preview on Mac OS X Snow Leopard, and I have double-checked with a fresh download on another Mac. Figure 1-4 is just the first occurrence. Figures 3-1, 3-2 and 3-4 are also missing, as are parts of Figure 4-1 and all of Figures 5-3, 5-4, 5-5, 6-2, 6-3, 6-4, 6-5, 6-6, 6-7, 6-8, much of 6-9, all of 6-10, 6-11, 7-4, 8-1, 9-8,10-2, 10-3, 11-1, 11-2, 11-3, part of 11-4, all of 11-5, 11-7, 11-8, 11-9, 11-10, 11-13, and 11-17.
Author Comment:

We downloaded the PDF file in your account as a test, and all the images you cite in your message display fine. Granted, we are using Acrobat. Would it be possible for you to try this?

On page 22:
Command java -jar hello-world-0.0.1-SNAPSHOT.jar jobs/helloWorld.xml helloWorldJob will throw this error:

Exception in thread "main" java.lang.NullPointerException
at sun.launcher.LauncherHelper.getMainClassFromJar(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

Tried even packiing a jar with the official source code downloaded from this page, with no luck.

On page 438:

Figure 11-19 refers to "StepRequestExecutionHandler", the class is actually "StepExecutionRequestHandler"


    1. Pro JavaFX 8


      View Book

    2. Practical Eclipse Rich Client Platform Projects


      View Book

    3. Pro Android 4


      View Book

    4. Pro Spring


      View Book