SpringOne 2009: Spring Batch 2.0 Overview

A batch...Disclaimer: This entry has been written while listening to the talk. Please forgive me any typographical or grammatical errors resulting from this approach.

Next we are up to an overview about the new features in Spring Batch 2.0 by Lucas Ward.

The general structure is:

  • A job has an identity.
  • Jobs have steps.
  • Each execution has a start time, stop time and a status.
  • A job can be restarted after a failure as a new execution.
  • Each execution can tell us, how many items were processed, how many were commited, rollbacked, etc.

Then he started to proceed to explain the user guide. Then he explained the items you can read in the “What’s new” section of the user guide. For folks updating this documentation probably offers an even better overview. Therefor I will from now on focus on the important differences between 1.x and 2.0 to save space (the underlying theme being that batch processing should be supported by a distinct and easy to understand programming model):

  • Spring Batch 2.0 is doing chunk oriented processing.
  • Generics have been added to Spring Batch.
  • Item transformers now are item processors and no longer a part of the iten writer but rather of the step.
  • Deletion of read items can be handled by returning null from the ItemProcessor.
  • First all reading and processing is done, then one write follows.
  • The StepExecutionListener can act before and after a step takes place.
  • There are many new annotations in order to support the various hooks provide by Spring Batch. Search for “Before…” and “After…” in the JavaDoc API.
  • Batch 2.0 supports non-sequential execution of steps.
  • Spring Batch will support late binding with Spring 3.0 EL expressions making e.g. the job parameters, the current run and other things accessible.
  • The JobOperator controls job execution (e.g. starting, stopping, etc.).
  • The JobParametersIncrementer allows to modifiy job pamareters in order to get new job instances.
  • There is partitioning support. There are strategies like local, GridGain, Terracotta and more.
  • Jobs can be launched from the command line or via a TaskExecutor.

Best quote of the day goes to Lucas: “It’s not as cool as Spring Web MCV, but hey… we are Batch guys – we are not cool” 🙂

Slowly I’m starting to suspect that SpringOne no longer is valuable for me – probably I’m doing too much with Spring and some of the presentations here are better introductions than anything else. Lucas is a decent presenter, sadly major parts of his talk consisted of the user guide and reference documentation – if I want to read documentation I do that. I don’t go to presentations to learn about things I can read about. So another thumbs down for this presentation, not due to Lucas’ skills but rather to the interest level of the presentation and the few tidbits of information new to me. A least he ended 30 minutes early and thus saved me from wasting more time.

2 Responses to “SpringOne 2009: Spring Batch 2.0 Overview”

  1. Lucas Ward  on May 12th, 2009

    Thanks for the feedback. Creating the content for these types of presentations is always difficult, since you have to guess the knowledge level and familiarity of attendees before they even know they’re going to be there. 🙂 The presentation I gave at SpringOne Europe was definitely more useful when I gave it at the US version, which was before we had created the reference documentation. Although, for those who hadn’t read the reference documentation, I hope it was a reasonable summary of the changes.

    What kind of content do you look for in these types of presentations? Would you prefer more code orientated? (It sounds like that’s the case)

    • Thomas_Biskup  on May 13th, 2009

      I guess I usually want to see more than what I can find in the reference documentation. My line of thinking for conference presentations always has been to favour talks that include at least one completely new original idea for me. Please don’t take this as an insult or attack – your talk was neither boring nor uninteresting. I just felt that I could have learned most of the content from paging through the reference documentation and if I personally want to do that I either reserve some of my time for studying the documentation or I purchase a training. On conferences I expect some new idea, approach or aspect not available by simply reading the included docs to be thrilled.
      I know from my own talks that it’s very hard to achieve that, especially if you are present on many conferences. Nonetheless I find it a worthy goal. At least in my experience talks achieving this goal are a lot more likely to be remembered as great talks.
      As for very technical talks… if you just cannot find that “very special insight or idea” it might be nice to spice up a feature talk with more examples fro real life projects explaining how these features helped to solve one problem or another – this quickly provides a feel for “having left the basic introductory level” and hearing something more advanced.
      Hope this helps!