SlideShare una empresa de Scribd logo
1 de 26
Descargar para leer sin conexión
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

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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 a 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 a 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
 

Último

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....ShaimaaMohamedGalal
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendArshad QA
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 

Último (20)

Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Clustering techniques data mining book ....
Clustering techniques data mining book ....Clustering techniques data mining book ....
Clustering techniques data mining book ....
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Test Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and BackendTest Automation Strategy for Frontend and Backend
Test Automation Strategy for Frontend and Backend
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 

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