JSR-352, Spring Batch and You
-
Upload
spring-io -
Category
Technology
-
view
1.184 -
download
3
description
Transcript of JSR-352, Spring Batch and You
![Page 1: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/1.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 1 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
JSR-352, SPRING BATCH,JSR-352, SPRING BATCH,AND YOUAND YOU
Created by / Michael T Minella @michaelminella
![Page 2: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/2.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 2 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
WHO IS THIS GUY?WHO IS THIS GUY?
Author of Pro Spring BatchMember of the expert group for JSR-352Project lead for Spring Batch
![Page 3: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/3.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 3 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
I DO A LOT OF BATCH ;)I DO A LOT OF BATCH ;)
![Page 4: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/4.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 4 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
NO NEED TO TAKE NOTES!NO NEED TO TAKE NOTES!These talks are being recorded...These slides and code are on Github
![Page 5: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/5.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 5 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
FIND IT ALL HEREFIND IT ALL HERE
![Page 6: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/6.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 6 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
![Page 7: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/7.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 7 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
??
![Page 8: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/8.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 8 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
33
![Page 9: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/9.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 9 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
JSR-352JSR-352
![Page 10: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/10.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 10 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
SPRING BATCH'S IMPLE‐SPRING BATCH'S IMPLE‐MENTATION OF JSR-352MENTATION OF JSR-352
![Page 11: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/11.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 11 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
SPRING BATCH BEYONDSPRING BATCH BEYONDJSR-352JSR-352
![Page 12: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/12.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 12 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
EXPECTATIONSEXPECTATIONSBasic knowledge of SpringBasic knowledge of Spring Batch
![Page 13: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/13.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 13 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
? WHEN YOU HAVE THEM? WHEN YOU HAVE THEM
![Page 14: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/14.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 14 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
JSR-352JSR-352
![Page 15: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/15.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 15 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
JSR-352 introduces an exciting new Javaspecification for building, deploying, and
running batch applications.- Chris Vignola
![Page 16: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/16.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 16 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
SPRING'S INVOLVEMENTSPRING'S INVOLVEMENT
![Page 17: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/17.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 17 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
SPRING BATCH IS ASPRING BATCH IS ALEADER IN THE SPACELEADER IN THE SPACE
![Page 18: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/18.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 18 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
RESULTS OF THE SPEC?RESULTS OF THE SPEC?
![Page 19: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/19.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 19 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
![Page 20: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/20.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 20 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
![Page 21: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/21.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 21 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
STRUCTURALLY THESTRUCTURALLY THESAMESAME
![Page 22: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/22.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 22 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
33API for building batch componentsA DSL for configuring batch componentsA contract of how batch components interact
![Page 23: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/23.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 23 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
HIGH LEVEL DIFFERENCESHIGH LEVEL DIFFERENCES
![Page 24: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/24.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 24 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
SPRING BATCH JOBSPRING BATCH JOB<job id="personJob"> <step id="step1"> <tasklet> <chunk commit-interval="5" reader="itemReader" processor="itemProcessor" writer="itemWriter" /> </tasklet> </step></job>
![Page 25: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/25.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 25 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
JSR-352 JOBJSR-352 JOB<job id="personJob"> <step id="step1"> <chunk item-count="5"> <reader ref="itemReader"/> <processor ref="itemProcessor"/> <writer ref="itemWriter"/> </chunk> </step></job>
![Page 26: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/26.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 26 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
<!-- Spring Batch --><job id="personJob"> <step id="step1"> <tasklet> <chunk commit-interval="5" reader="itemReader" processor="itemProcessor" writer="itemWriter"/> </tasklet> </step></job>
<!-- JSR-352 --><job id="personJob"> <step id="step1"> <chunk item-count="5"> <reader ref="itemReader"/> <processor ref="itemProcessor"/> <writer ref="itemWriter"/> </chunk> </step></job>
![Page 27: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/27.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 27 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
??
![Page 28: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/28.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 28 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
DEPENDENCY INJECTIONDEPENDENCY INJECTIONFoundational technology of Spring BatchNot required with JSR-352
![Page 29: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/29.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 29 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
REFERENCES IN JSR-352REFERENCES IN JSR-352<job id="personJob"> <step id="step1"> <chunk item-count="5"> <reader ref="itemReader"/> <processor ref="itemProcessor"/> <writer ref="itemWriter"/> </chunk> </step></job>
![Page 30: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/30.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 30 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
REFERENCES POINT TO 1REFERENCES POINT TO 1OF 3 PLACESOF 3 PLACES
Spring beanbatch.xml definitionThe class itself
![Page 31: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/31.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 31 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
SPRING BEANSPRING BEAN<bean id="itemWriter" class="org.springframework.batch.item.xml.StaxEventItemWriter" <property name="resource" ref="outputFile" /> <property name="marshaller" ref="customerMarshaller" /> <property name="rootTagName" value="customers" /></bean>
![Page 32: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/32.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 32 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
BATCH.XMLBATCH.XML<batch-artifacts xmlns="http://xmlns.jcp.org/xml/ns/javaee">
<ref id="itemReader" class="org.sf.jsr.demo.ItemReader" /> <ref id="itemProcessor" class="org.sf.jsr.demo.ItemProcessor" /> <ref id="itemWriter" class="org.sf.jsr.demo.ItemWriter" />
</batch-artifacts>
![Page 33: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/33.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 33 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
THE CLASS ITSELFTHE CLASS ITSELF<job id="personJob"> <step id="step1"> <chunk item-count="5"> <reader ref="org.sf.jsr.demo.ItemReader"/> <processor ref="org.sf.jsr.demo.ItemProcessor"/> <writer ref="org.sf.jsr.demo.ItemWriter"/> </chunk> </step></job>
![Page 34: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/34.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 34 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
PROPERTIESPROPERTIESSpring injects them on bean definitionsJSR-352 injects properties from the job definitionJSR-352 properties are Strings only
![Page 35: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/35.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 35 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
SPRING BATCH JOBSPRING BATCH JOB<job id="formatJob"> <step id="step1"> <tasklet> <chunk reader="fileReader" writer="xmlWriter" commit-interval="#{jobParameters['commit.interval']}"/> </tasklet> </step></job>
![Page 36: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/36.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 36 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
JSR-352 JOBJSR-352 JOB<job id="personJob"> <step id="step1"> <chunk item-count="#{jobParameters['commit.interval']}"> <reader ref="fileReader"> <properties> <property name="fileName" value="#{jobParameters['input.fileName']}" </properties> </reader> <writer ref="xmlWriter"> <properties> <property name="fileName" value="#{jobParameters['output.fileName']}" </properties> </writer> </chunk> </step></job>
![Page 37: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/37.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 37 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
INJECTION OF PROPER‐INJECTION OF PROPER‐TIESTIES
@Inject@BatchPropertypublic String fileName;
@Inject@BatchProperty(name="otherProperty")public String otherProperty;
![Page 38: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/38.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 38 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
??
![Page 39: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/39.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 39 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
LET'S BUILD AN APP!LET'S BUILD AN APP!
![Page 40: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/40.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 40 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
00:00 -00:34
![Page 41: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/41.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 41 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
LOGS OF A VIRAL VIDEOLOGS OF A VIRAL VIDEOReleased in 2003.Downloaded 1.1 million times the first 2 weeksSince been downloaded 40 million times since it wasmoved to YouTube2008, Andy Baio posted the Apache logs for the first 6monthsFile is 1.6 GB unzipped and available via BitTorentFile was originally called "ghyslain_razaa.wmv"File was later renamed to "Star_Wars_Kid.wmv"
![Page 42: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/42.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 42 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
WHO WAS WATCHINGWHO WAS WATCHINGTHIS VIDEO?THIS VIDEO?
![Page 43: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/43.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 43 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
OUR JOBOUR JOB
![Page 44: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/44.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 44 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
STEP PROCESSING MOD‐STEP PROCESSING MOD‐ELSELS
![Page 45: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/45.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 45 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
BATCHLETBATCHLET
![Page 46: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/46.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 46 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
BATCHLET = STOPPABLE‐BATCHLET = STOPPABLE‐TASKLETTASKLET
![Page 47: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/47.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 47 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
public interface Tasklet { RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception;}
public interface StoppableTasklet extends Tasklet { void stop();}
public interface Batchlet { public String process() throws Exception; public void stop() throws Exception; }
![Page 48: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/48.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 48 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
STEP 1...SPLIT THE FILESTEP 1...SPLIT THE FILE
![Page 49: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/49.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 49 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
LAUNCHINGLAUNCHING
![Page 50: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/50.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 50 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
JOBOPERATORJOBOPERATORJobOperator jobOperator = BatchRuntime.getJobOperator();
// startlong jobExecutionId = jobOperator.start("myJob", new Properties());
// restartlong newJobExecutionId = jobOperator.restart(jobExecutionId, new Properties());
// stopjobOperator.stop(jobExecutionid);
![Page 51: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/51.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 51 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
CHUNK PROCESSINGCHUNK PROCESSING
![Page 52: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/52.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 52 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
SPRING BATCHSPRING BATCH
![Page 53: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/53.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 53 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
SPRING BATCH REALLYSPRING BATCH REALLY
![Page 54: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/54.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 54 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
JSR-352JSR-352
![Page 55: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/55.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 55 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
CHUNK RELATED INTER‐CHUNK RELATED INTER‐FACESFACES
ItemReaderItemProcessorItemWriter
![Page 56: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/56.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 56 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
CHECKPOINTSCHECKPOINTSItemCustom
![Page 57: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/57.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 57 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
STEP 2...IMPORT THE FILESTEP 2...IMPORT THE FILE
![Page 58: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/58.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 58 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
ERROR HANDLINGERROR HANDLING
![Page 59: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/59.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 59 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
SKIPSKIP<job id="skip" xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="1.0"> <step id="step1"> <chunk skip-limit="3"> <reader ref="retryableListReader"/> <writer ref="fileWriter"/> <!-- Skippable exceptions --> <skippable-exception-classes> <include class="java.lang.RuntimeException"/> </skippable-exception-classes> </chunk> </step></job>
![Page 60: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/60.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 60 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
RETRYRETRY<job id="retry" xmlns="http://xmlns.jcp.org/xml/ns/javaee" version="1.0"> <step id="step1"> <chunk retry-limit="3"> <reader ref="retryableListReader"/> <writer ref="fileWriter"/>
<!-- Retryable exceptions --> <retryable-exception-classes> <include class="java.lang.RuntimeException"/> </retryable-exception-classes> </chunk> </step></job>
![Page 61: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/61.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 61 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
READ RETRIESREAD RETRIESSpring Batch hasn't supported read retriesJSR-352 allows read retriesExisting Spring Batch readers won't support read retry with3.0
![Page 62: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/62.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 62 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
SCALINGSCALING
![Page 63: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/63.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 63 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
SPLITSSPLITSSame as Spring Batch
![Page 64: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/64.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 64 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
PARTITIONINGPARTITIONINGExecutes chunks or multiple instances of Batchlets inparallelTwo configuration options
Hardcoded in XMLPartitionMapper
Adds two additional concepts...
![Page 65: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/65.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 65 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
PARTITION REDUCERPARTITION REDUCERProvides a hook for compensating logic upon failureReally just a specializedStepListener/StepExecutionListenr
![Page 66: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/66.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 66 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
PARTITION COLLECTOR/PARTITION COLLECTOR/ANALYZERANALYZER
Collector collects data from batch artifactsAnalyzer allows the ability to set ExitStatus after apartitioned step
![Page 67: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/67.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 67 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
SPRING BATCH'SSPRING BATCH'SIMPLEMENTATIONIMPLEMENTATION
![Page 68: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/68.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 68 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
SPRING BATCH STATUSSPRING BATCH STATUSReleased 3.0.0.M2 last nightPasses > 50% of the TCK tests3.0 will be JSR-352 compliant
![Page 69: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/69.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 69 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
"RAW" JSR-352 VERSION"RAW" JSR-352 VERSIONClasses: 8Lines of custom code: 826
![Page 70: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/70.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 70 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
33API for building batch componentsA DSL for configuring batch componentsA contract of how batch components interact
![Page 71: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/71.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 71 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
??
![Page 72: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/72.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 72 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
COMPONENTS!!!COMPONENTS!!!
![Page 73: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/73.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 73 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
JSR-352 PROVIDES 0JSR-352 PROVIDES 0IMPLEMENTATIONSIMPLEMENTATIONS
![Page 74: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/74.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 74 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
ITEM READERSITEM READERSAggregateItemReader
AmqpItemReader
FlatFileItemReader
HibernateCursorItemReader
HibernatePagingItemReader
IbatisPagingItemReader
ItemReaderAdapter
JdbcCursorItemReader
JdbcPagingItemReader
JmsItemReader
JpaPagingItemReader
ListItemReader
MongoItemReader
Neo4jItemReader
RepositoryItemReader
StoredProcedureItemReader
StaxEventItemReader
ITEM WRITERSITEM WRITERS
![Page 75: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/75.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 75 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
SAME APP...SPRING-IFIEDSAME APP...SPRING-IFIED
![Page 76: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/76.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 76 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
COMPARISONCOMPARISON
![Page 77: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/77.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 77 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
"RAW" JSR-352 VERSION"RAW" JSR-352 VERSIONClasses: 8Lines of custom code: 826
![Page 78: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/78.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 78 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
SPRING JSR-352 VERSIONSPRING JSR-352 VERSIONClasses: 5Lines of custom code: 596
![Page 79: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/79.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 79 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
BEYOND JSR-352BEYOND JSR-352
![Page 80: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/80.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 80 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
SPRING!SPRING!
![Page 81: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/81.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 81 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
TYPE SAFE PROPERTIESTYPE SAFE PROPERTIES
![Page 82: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/82.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 82 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
NO INHERITENCENO INHERITENCE
![Page 83: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/83.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 83 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
SCALABILITYSCALABILITY
![Page 84: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/84.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 84 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
JSR-352 IS SINGLE JVMJSR-352 IS SINGLE JVMONLYONLY
![Page 85: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/85.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 85 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
SPRING BATCH SCALESSPRING BATCH SCALESBEYOND 1 JVMBEYOND 1 JVM
![Page 86: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/86.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 86 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
REMOTE CHUNKINGREMOTE CHUNKING
![Page 87: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/87.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 87 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
REMOTE PARTITIONINGREMOTE PARTITIONING
![Page 88: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/88.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 88 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
BATCH DOESN'T OCCURBATCH DOESN'T OCCURIN A VACUUMIN A VACUUM
![Page 89: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/89.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 89 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
LAUNCHING JOBS VIALAUNCHING JOBS VIAMESSAGESMESSAGES
![Page 90: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/90.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 90 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
SPRING HADOOPSPRING HADOOP
![Page 91: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/91.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 91 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
SPRING XDSPRING XD
![Page 92: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/92.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 92 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
??
![Page 93: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/93.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 93 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
FIND THIS DECK ANDFIND THIS DECK ANDDEMO CODE:DEMO CODE:
Github
![Page 94: JSR-352, Spring Batch and You](https://reader034.fdocuments.net/reader034/viewer/2022051012/5455f79caf7959755d8b4b27/html5/thumbnails/94.jpg)
9/13/13 4:33 PMJSR-352, Spring Batch, and You
Page 94 of 94http://mminella.github.io/jsr352-springbatch-and-you/?print-pdf#/
KEEP IN TOUCH!KEEP IN TOUCH!Michael Minella
Twitter: Github:
Spring BatchSite: Session replays on YouTube:
SpringSite:
@MichaelMinellamminella
Spring BatchYouTube
Spring IO