SlideShare a Scribd company logo
1 of 26
Download to read offline
Spring Batch Groovy & Gradle integrationSpring Batch Groovy & Gradle integration
Because we like it…Because we like it…
because we have fun with itbecause we have fun with it
About me:About me:
Born with C and Java
Github:
http://github.com/amr390
(mostly drops, and tests)
Working with Java and Javascript,
take any opportunity to use
groovy and python
(I love for both of them)
Grown up with Java
since 2000
Twitter: 390amr
(not much into it)
Spring Batch. Groovy and GradleSpring Batch. Groovy and Gradle
What is Spring BatchWhat is Spring Batch
Why integrating spring-batch with Groovy and GradleWhy integrating spring-batch with Groovy and Gradle
RequirementsRequirements
➢ DependenciesDependencies
➢ Gradle tasksGradle tasks
What is Spring BatchWhat is Spring Batch
➢Configuring Jobs, Tasks, Steps and stufConfiguring Jobs, Tasks, Steps and stuf
➢Running and Handling JobsRunning and Handling Jobs
Improving Spring Batch performanceImproving Spring Batch performance
➢Multi-threadingMulti-threading
➢Master-Slave approachMaster-Slave approach
➢Parallelizing Step executionsParallelizing Step executions
What is Spring Batch I
Batch Framework
Technical services
Functionality to process large volumes of records
ItemReader, ItemWriter, ItemProcessor
Stateless or Stateful step executions
High-volume
High-performance
High-scalability
Trough optimization
Partitioning techniques
What is Spring Batch IIWhat is Spring Batch II
What is Spring Batch IIIWhat is Spring Batch III
What is Spring Batch IVWhat is Spring Batch IV
STEP:
➔ Custom tasklet
➔ Restartable
➔ Skippable
➔ Retry
➔ Rollback
➔ Listeners Before/After
✗ Reader
✗ Processor
✗ Writer
✗ Chunk
✗ Step
➔ Step flow (on status)
What is Spring Batch: exampleWhat is Spring Batch: example
Philae Lander dataPhilae Lander data
Philae Lander is a spacecraft that sends analysis data from comet 67P/Churyumov–
Gerasimenko (https://en.wikipedia.org/wiki/Philae_(spacecraft))
Sends tones data in files encrypted in Klingon or Murciano.
Files are zipped, and organized with a naming rule of file1, file2 etc ...
It is always fun using groovy
Can be nicely coupled to other platforms Grifon, Grails...
Power of Gradle
Homogeneous Architecture
Why integrating Spring-batch withWhy integrating Spring-batch with
groovy and Gradlegroovy and Gradle
Plug insPlug insRepositoriesRepositories
DependenciesDependencies
TasksTasks
Requeriments IIRequeriments II
Repositories
Plugins
Dependencies IIIDependencies III
Dependencies
Requirements IVRequirements IV
Gradle tasks
MainClassName: Sets the project main class (because it is a global definition)
run: sets the required arguments for run task, in this case the job configuration class and the
Job to be launched.
@Configuration
@EnableBatchProcessing
Injects
a JobRepository
a JobLauncher
a JobRegistry
a PlatformTransactionManager
a JobBuilderFactory
a StepBuilderFactory
Spring Batch Groovy & GradleSpring Batch Groovy & Gradle
integrationintegration
Job definition configurations, steps, tasklets and stuf
Spring Batch Groovy & GradleSpring Batch Groovy & Gradle
integrationintegration
Running and Handling Jobs
Spring batch admin
Spring Batch Groovy & GradleSpring Batch Groovy & Gradle
integrationintegration
Running and Handling Jobs
Job Launchers
org.springframework.batch.core.launch
Interface JobLauncher
All Known Implementing Classes:
SimpleJobLauncher
JobExecution run(Job job,
JobParameters jobParameters)
throws JobExecutionAlreadyRunningException,
JobRestartException,
JobInstanceAlreadyCompleteException,
JobParametersInvalidException
Spring Batch Groovy & GradleSpring Batch Groovy & Gradle
integrationintegration
Running and Handling Jobs
Job Launchers
org.springframework.batch.core.launch.support
Class CommandLineJobRunner
Spring Batch Groovy & GradleSpring Batch Groovy & Gradle
integrationintegration
Performance improvement
There different approached in order to improve the job execution performance
Multi-threading:
Using a
ThreadPoolTaskExecutor
Remote chunking:
Master executes read
phase of step slaves are
distributed in nodes and
execute processing and
writing from a
chunkProvider.
Partitioning:
Clone Job
execution step
and run steps in
parallel
Remote
Partitioning:
Instead of running
the steps clone
locally steps are
distributed
Parallel steps:
step execution is splitted to
execute several steps in
parallel flows.
Spring Batch Groovy & GradleSpring Batch Groovy & Gradle
integrationintegration
Multi
threading
Spring Batch Groovy & GradleSpring Batch Groovy & Gradle
integrationintegration
Multi
threading
Using task namespace
<task:executor id="taskExecutor"
pool-size="10" />
By java configuration method:
ThreadPoolTaskExecutor taskExecutor
...
Steps must be thread safe
Spring Batch Groovy & GradleSpring Batch Groovy & Gradle
integrationintegration
Master-Slave
approach
PartitionHandler: Interface defining the responsabilities of
controlling the execution of partitioned step
Partitioner: Interface to determine the way of creating
partitions (key-range, file-chunks...)
Spring Batch Groovy & GradleSpring Batch Groovy & Gradle
integrationintegration
Master-Slave
approach
Spring Batch Groovy & GradleSpring Batch Groovy & Gradle
integrationintegration
Parallelizing Step executions
Spring Batch Groovy & GradleSpring Batch Groovy & Gradle
integrationintegration
Parallelizing Step executions
@Bean
public SimpleFlow mainFlow() {
SimpleFlow splitFlow = new FlowBuilder<SimpleFlow>("Split Flow")
.split(new SimpleAsyncTaskExecutor())
.add(flow2(), flow3())
.build();
return new FlowBuilder<SimpleFlow>("Main Flow")
.start(flow1())
.next(splitFlow)
.end();
}
<batch:step id="step1" next="">...</batch:step>
<batch:split id="splitSteps" next="step3">
<batch:flow> <batch:step … /></batch:flow>
<batch:flow> <batch:step … /></batch:flow>
</batch:split>
<batch:step id="step3">
<batch:tasklet ref="tasklet" />
</batch:step>
Demo Github: https://github.com/amr390/groovy-springbatch-demo
Spring batch reference page: http://docs.spring.io/spring-batch/trunk/reference/
Spring batch in action: http://www.manning.com/templier/
Spring batch horizontal-vertical scaling:
http://www.ontheserverside.com//blog/2014/07/23/horizontal-and-vertical-scaling-strategies-for-batch-applications
Spring batch admin: http://docs.spring.io/spring-batch-admin/
Spring Integration reference page: http://docs.spring.io/spring-integration/refer
Groovy: http://www.groovy-lang.org/documentation.html
Gradle: https://docs.gradle.org/current/release-notes
Spring Batch Groovy & GradleSpring Batch Groovy & Gradle
integrationintegration
References

More Related Content

What's hot

Dsl로 만나는 groovy
Dsl로 만나는 groovyDsl로 만나는 groovy
Dsl로 만나는 groovySeeyoung Chang
 
Paving the road with Jakarta EE and Apache TomEE - JCON 2021
Paving the road with Jakarta EE  and Apache TomEE - JCON 2021Paving the road with Jakarta EE  and Apache TomEE - JCON 2021
Paving the road with Jakarta EE and Apache TomEE - JCON 2021César Hernández
 
Understanding how concurrency work in os
Understanding how concurrency work in osUnderstanding how concurrency work in os
Understanding how concurrency work in osGenchiLu1
 
Golang start and tips
Golang start and tipsGolang start and tips
Golang start and tipsAaron King
 
An introduction to_golang.avi
An introduction to_golang.aviAn introduction to_golang.avi
An introduction to_golang.aviSeongJae Park
 
Develop Android app using Golang
Develop Android app using GolangDevelop Android app using Golang
Develop Android app using GolangSeongJae Park
 
Golang for PHP programmers: A practical introduction
Golang for PHP programmers: A practical introductionGolang for PHP programmers: A practical introduction
Golang for PHP programmers: A practical introductionRichard Tuin
 
It is easy contributing to open source - JCON 2020
It is easy contributing to open source - JCON 2020It is easy contributing to open source - JCON 2020
It is easy contributing to open source - JCON 2020César Hernández
 
Buildr - build like you code
Buildr -  build like you codeBuildr -  build like you code
Buildr - build like you codeIzzet Mustafaiev
 
How to debug mruby (rubyconftw2014)
How to debug mruby (rubyconftw2014)How to debug mruby (rubyconftw2014)
How to debug mruby (rubyconftw2014)yamanekko
 
GradleのREPLプラグイン紹介 #jggug
GradleのREPLプラグイン紹介 #jggugGradleのREPLプラグイン紹介 #jggug
GradleのREPLプラグイン紹介 #jggugkyon mm
 
(Live) build and run golang web server on android.avi
(Live) build and run golang web server on android.avi(Live) build and run golang web server on android.avi
(Live) build and run golang web server on android.aviSeongJae Park
 
Writing mruby Debugger
Writing mruby DebuggerWriting mruby Debugger
Writing mruby Debuggeryamanekko
 
Android build process (1)
Android build process (1)Android build process (1)
Android build process (1)Shubham Goyal
 
Golang from Scala developer’s perspective
Golang from Scala developer’s perspectiveGolang from Scala developer’s perspective
Golang from Scala developer’s perspectiveSveta Bozhko
 

What's hot (20)

Dsl로 만나는 groovy
Dsl로 만나는 groovyDsl로 만나는 groovy
Dsl로 만나는 groovy
 
Paving the road with Jakarta EE and Apache TomEE - JCON 2021
Paving the road with Jakarta EE  and Apache TomEE - JCON 2021Paving the road with Jakarta EE  and Apache TomEE - JCON 2021
Paving the road with Jakarta EE and Apache TomEE - JCON 2021
 
Understanding how concurrency work in os
Understanding how concurrency work in osUnderstanding how concurrency work in os
Understanding how concurrency work in os
 
Golang start and tips
Golang start and tipsGolang start and tips
Golang start and tips
 
An introduction to_golang.avi
An introduction to_golang.aviAn introduction to_golang.avi
An introduction to_golang.avi
 
Develop Android app using Golang
Develop Android app using GolangDevelop Android app using Golang
Develop Android app using Golang
 
Golang for PHP programmers: A practical introduction
Golang for PHP programmers: A practical introductionGolang for PHP programmers: A practical introduction
Golang for PHP programmers: A practical introduction
 
It is easy contributing to open source - JCON 2020
It is easy contributing to open source - JCON 2020It is easy contributing to open source - JCON 2020
It is easy contributing to open source - JCON 2020
 
Groovy and noteworthy
Groovy and noteworthyGroovy and noteworthy
Groovy and noteworthy
 
Buildr - build like you code
Buildr -  build like you codeBuildr -  build like you code
Buildr - build like you code
 
Golang
GolangGolang
Golang
 
How to debug mruby (rubyconftw2014)
How to debug mruby (rubyconftw2014)How to debug mruby (rubyconftw2014)
How to debug mruby (rubyconftw2014)
 
GradleのREPLプラグイン紹介 #jggug
GradleのREPLプラグイン紹介 #jggugGradleのREPLプラグイン紹介 #jggug
GradleのREPLプラグイン紹介 #jggug
 
(Live) build and run golang web server on android.avi
(Live) build and run golang web server on android.avi(Live) build and run golang web server on android.avi
(Live) build and run golang web server on android.avi
 
Writing mruby Debugger
Writing mruby DebuggerWriting mruby Debugger
Writing mruby Debugger
 
Go lang
Go langGo lang
Go lang
 
TDD with Spock @xpdays_ua
TDD with Spock @xpdays_uaTDD with Spock @xpdays_ua
TDD with Spock @xpdays_ua
 
Android build process (1)
Android build process (1)Android build process (1)
Android build process (1)
 
Besut Kode Challenge 1
Besut Kode Challenge 1Besut Kode Challenge 1
Besut Kode Challenge 1
 
Golang from Scala developer’s perspective
Golang from Scala developer’s perspectiveGolang from Scala developer’s perspective
Golang from Scala developer’s perspective
 

Similar to Spring-batch Groovy y Gradle

Java to Golang: An intro by Ryan Dawson Seldon.io
Java to Golang: An intro by Ryan Dawson Seldon.ioJava to Golang: An intro by Ryan Dawson Seldon.io
Java to Golang: An intro by Ryan Dawson Seldon.ioMauricio (Salaboy) Salatino
 
Spring Northwest Usergroup Grails Presentation
Spring Northwest Usergroup Grails PresentationSpring Northwest Usergroup Grails Presentation
Spring Northwest Usergroup Grails Presentationajevans
 
Spring boot 3g
Spring boot 3gSpring boot 3g
Spring boot 3gvasya10
 
GR8Conf 2011: Groovy Maven Builds
GR8Conf 2011: Groovy Maven BuildsGR8Conf 2011: Groovy Maven Builds
GR8Conf 2011: Groovy Maven BuildsGR8Conf
 
Ratpack - Classy and Compact Groovy Web Apps
Ratpack - Classy and Compact Groovy Web AppsRatpack - Classy and Compact Groovy Web Apps
Ratpack - Classy and Compact Groovy Web AppsJames Williams
 
Griffon - Making Swing Fun Again
Griffon - Making Swing Fun AgainGriffon - Making Swing Fun Again
Griffon - Making Swing Fun AgainDanno Ferrin
 
Why you should embrace Gradle and ditch Maven
Why you should embrace Gradle and ditch MavenWhy you should embrace Gradle and ditch Maven
Why you should embrace Gradle and ditch MavenGijsLeussink
 
Groovy And Grails Introduction
Groovy And Grails IntroductionGroovy And Grails Introduction
Groovy And Grails IntroductionEric Weimer
 
Grails @ Java User Group Silicon Valley
Grails @ Java User Group Silicon ValleyGrails @ Java User Group Silicon Valley
Grails @ Java User Group Silicon ValleySven Haiges
 
Use Groovy&Grails in your spring boot projects
Use Groovy&Grails in your spring boot projectsUse Groovy&Grails in your spring boot projects
Use Groovy&Grails in your spring boot projectsParadigma Digital
 
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...Guillaume Laforge
 
JavaOne 2009 BOF-5189 Griffon In Depth
JavaOne 2009 BOF-5189 Griffon In DepthJavaOne 2009 BOF-5189 Griffon In Depth
JavaOne 2009 BOF-5189 Griffon In DepthDanno Ferrin
 
carrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-APIcarrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-APIYoni Davidson
 

Similar to Spring-batch Groovy y Gradle (20)

Java to Golang: An intro by Ryan Dawson Seldon.io
Java to Golang: An intro by Ryan Dawson Seldon.ioJava to Golang: An intro by Ryan Dawson Seldon.io
Java to Golang: An intro by Ryan Dawson Seldon.io
 
Spring Northwest Usergroup Grails Presentation
Spring Northwest Usergroup Grails PresentationSpring Northwest Usergroup Grails Presentation
Spring Northwest Usergroup Grails Presentation
 
Spring boot 3g
Spring boot 3gSpring boot 3g
Spring boot 3g
 
Groovy Maven Builds
Groovy Maven BuildsGroovy Maven Builds
Groovy Maven Builds
 
Why Gradle?
Why Gradle?Why Gradle?
Why Gradle?
 
GR8Conf 2011: Groovy Maven Builds
GR8Conf 2011: Groovy Maven BuildsGR8Conf 2011: Groovy Maven Builds
GR8Conf 2011: Groovy Maven Builds
 
Ratpack - Classy and Compact Groovy Web Apps
Ratpack - Classy and Compact Groovy Web AppsRatpack - Classy and Compact Groovy Web Apps
Ratpack - Classy and Compact Groovy Web Apps
 
What's New in Groovy 1.6?
What's New in Groovy 1.6?What's New in Groovy 1.6?
What's New in Groovy 1.6?
 
Griffon - Making Swing Fun Again
Griffon - Making Swing Fun AgainGriffon - Making Swing Fun Again
Griffon - Making Swing Fun Again
 
Why you should embrace Gradle and ditch Maven
Why you should embrace Gradle and ditch MavenWhy you should embrace Gradle and ditch Maven
Why you should embrace Gradle and ditch Maven
 
Gradle in 45min
Gradle in 45minGradle in 45min
Gradle in 45min
 
Groovy And Grails Introduction
Groovy And Grails IntroductionGroovy And Grails Introduction
Groovy And Grails Introduction
 
Grails @ Java User Group Silicon Valley
Grails @ Java User Group Silicon ValleyGrails @ Java User Group Silicon Valley
Grails @ Java User Group Silicon Valley
 
Use Groovy&Grails in your spring boot projects
Use Groovy&Grails in your spring boot projectsUse Groovy&Grails in your spring boot projects
Use Groovy&Grails in your spring boot projects
 
Griffon Presentation
Griffon PresentationGriffon Presentation
Griffon Presentation
 
Enter the gradle
Enter the gradleEnter the gradle
Enter the gradle
 
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
JavaOne 2008 - TS-5793 - Groovy and Grails, changing the landscape of Java EE...
 
JavaOne 2009 BOF-5189 Griffon In Depth
JavaOne 2009 BOF-5189 Griffon In DepthJavaOne 2009 BOF-5189 Griffon In Depth
JavaOne 2009 BOF-5189 Griffon In Depth
 
carrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-APIcarrow - Go bindings to Apache Arrow via C++-API
carrow - Go bindings to Apache Arrow via C++-API
 
Why gradle
Why gradle Why gradle
Why gradle
 

Recently uploaded

WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxAnnaArtyushina1
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburgmasabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...masabamasaba
 

Recently uploaded (20)

WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 

Spring-batch Groovy y Gradle

  • 1. Spring Batch Groovy & Gradle integrationSpring Batch Groovy & Gradle integration Because we like it…Because we like it… because we have fun with itbecause we have fun with it
  • 2. About me:About me: Born with C and Java Github: http://github.com/amr390 (mostly drops, and tests) Working with Java and Javascript, take any opportunity to use groovy and python (I love for both of them) Grown up with Java since 2000 Twitter: 390amr (not much into it)
  • 3. Spring Batch. Groovy and GradleSpring Batch. Groovy and Gradle What is Spring BatchWhat is Spring Batch Why integrating spring-batch with Groovy and GradleWhy integrating spring-batch with Groovy and Gradle RequirementsRequirements ➢ DependenciesDependencies ➢ Gradle tasksGradle tasks What is Spring BatchWhat is Spring Batch ➢Configuring Jobs, Tasks, Steps and stufConfiguring Jobs, Tasks, Steps and stuf ➢Running and Handling JobsRunning and Handling Jobs Improving Spring Batch performanceImproving Spring Batch performance ➢Multi-threadingMulti-threading ➢Master-Slave approachMaster-Slave approach ➢Parallelizing Step executionsParallelizing Step executions
  • 4. What is Spring Batch I Batch Framework Technical services Functionality to process large volumes of records ItemReader, ItemWriter, ItemProcessor Stateless or Stateful step executions High-volume High-performance High-scalability Trough optimization Partitioning techniques
  • 5. What is Spring Batch IIWhat is Spring Batch II
  • 6. What is Spring Batch IIIWhat is Spring Batch III
  • 7. What is Spring Batch IVWhat is Spring Batch IV STEP: ➔ Custom tasklet ➔ Restartable ➔ Skippable ➔ Retry ➔ Rollback ➔ Listeners Before/After ✗ Reader ✗ Processor ✗ Writer ✗ Chunk ✗ Step ➔ Step flow (on status)
  • 8. What is Spring Batch: exampleWhat is Spring Batch: example
  • 9. Philae Lander dataPhilae Lander data Philae Lander is a spacecraft that sends analysis data from comet 67P/Churyumov– Gerasimenko (https://en.wikipedia.org/wiki/Philae_(spacecraft)) Sends tones data in files encrypted in Klingon or Murciano. Files are zipped, and organized with a naming rule of file1, file2 etc ...
  • 10. It is always fun using groovy Can be nicely coupled to other platforms Grifon, Grails... Power of Gradle Homogeneous Architecture Why integrating Spring-batch withWhy integrating Spring-batch with groovy and Gradlegroovy and Gradle
  • 14. Requirements IVRequirements IV Gradle tasks MainClassName: Sets the project main class (because it is a global definition) run: sets the required arguments for run task, in this case the job configuration class and the Job to be launched.
  • 15. @Configuration @EnableBatchProcessing Injects a JobRepository a JobLauncher a JobRegistry a PlatformTransactionManager a JobBuilderFactory a StepBuilderFactory Spring Batch Groovy & GradleSpring Batch Groovy & Gradle integrationintegration Job definition configurations, steps, tasklets and stuf
  • 16. Spring Batch Groovy & GradleSpring Batch Groovy & Gradle integrationintegration Running and Handling Jobs Spring batch admin
  • 17. Spring Batch Groovy & GradleSpring Batch Groovy & Gradle integrationintegration Running and Handling Jobs Job Launchers org.springframework.batch.core.launch Interface JobLauncher All Known Implementing Classes: SimpleJobLauncher JobExecution run(Job job, JobParameters jobParameters) throws JobExecutionAlreadyRunningException, JobRestartException, JobInstanceAlreadyCompleteException, JobParametersInvalidException
  • 18. Spring Batch Groovy & GradleSpring Batch Groovy & Gradle integrationintegration Running and Handling Jobs Job Launchers org.springframework.batch.core.launch.support Class CommandLineJobRunner
  • 19. Spring Batch Groovy & GradleSpring Batch Groovy & Gradle integrationintegration Performance improvement There different approached in order to improve the job execution performance Multi-threading: Using a ThreadPoolTaskExecutor Remote chunking: Master executes read phase of step slaves are distributed in nodes and execute processing and writing from a chunkProvider. Partitioning: Clone Job execution step and run steps in parallel Remote Partitioning: Instead of running the steps clone locally steps are distributed Parallel steps: step execution is splitted to execute several steps in parallel flows.
  • 20. Spring Batch Groovy & GradleSpring Batch Groovy & Gradle integrationintegration Multi threading
  • 21. Spring Batch Groovy & GradleSpring Batch Groovy & Gradle integrationintegration Multi threading Using task namespace <task:executor id="taskExecutor" pool-size="10" /> By java configuration method: ThreadPoolTaskExecutor taskExecutor ... Steps must be thread safe
  • 22. Spring Batch Groovy & GradleSpring Batch Groovy & Gradle integrationintegration Master-Slave approach
  • 23. PartitionHandler: Interface defining the responsabilities of controlling the execution of partitioned step Partitioner: Interface to determine the way of creating partitions (key-range, file-chunks...) Spring Batch Groovy & GradleSpring Batch Groovy & Gradle integrationintegration Master-Slave approach
  • 24. Spring Batch Groovy & GradleSpring Batch Groovy & Gradle integrationintegration Parallelizing Step executions
  • 25. Spring Batch Groovy & GradleSpring Batch Groovy & Gradle integrationintegration Parallelizing Step executions @Bean public SimpleFlow mainFlow() { SimpleFlow splitFlow = new FlowBuilder<SimpleFlow>("Split Flow") .split(new SimpleAsyncTaskExecutor()) .add(flow2(), flow3()) .build(); return new FlowBuilder<SimpleFlow>("Main Flow") .start(flow1()) .next(splitFlow) .end(); } <batch:step id="step1" next="">...</batch:step> <batch:split id="splitSteps" next="step3"> <batch:flow> <batch:step … /></batch:flow> <batch:flow> <batch:step … /></batch:flow> </batch:split> <batch:step id="step3"> <batch:tasklet ref="tasklet" /> </batch:step>
  • 26. Demo Github: https://github.com/amr390/groovy-springbatch-demo Spring batch reference page: http://docs.spring.io/spring-batch/trunk/reference/ Spring batch in action: http://www.manning.com/templier/ Spring batch horizontal-vertical scaling: http://www.ontheserverside.com//blog/2014/07/23/horizontal-and-vertical-scaling-strategies-for-batch-applications Spring batch admin: http://docs.spring.io/spring-batch-admin/ Spring Integration reference page: http://docs.spring.io/spring-integration/refer Groovy: http://www.groovy-lang.org/documentation.html Gradle: https://docs.gradle.org/current/release-notes Spring Batch Groovy & GradleSpring Batch Groovy & Gradle integrationintegration References