SlideShare a Scribd company logo
1 of 23
Download to read offline
Data is the new oil


Introduction to SpringBatch


Presentation by Slobodan Lohja 2021
Photo illustration by Slate
Introduction to SpringBatch
Thank you to our sponsors!
• Certi
fi
ed IBM Application Developer for Collaboration (Lotus
Domino).

• 20[18,19,20,21] Collabsphere Speaker

• 2019 IBM Think Speaker

• 20[19,20,21] Senior Developer and technical team lead to
modernize mainframe apps to SpringBoot Microservices for
insurance claim processing

• 2021 Developer Specialist; Full stack. REACT/SpringBoot
modernization of JSP monolith Websphere application.

Introduction to SpringBatch
Slobodan Lohja
https://www.linkedin.com/in/slobodanlohja/
Introduction to SpringBatch
• Why open up your data


• What is Spring and SpringBatch


• Demo project - Let’s build something


• Closing thoughts


• Q/A
Agenda
Introduction to SpringBatch
• No access to data, no business intelligence


• No access to data, no artificial intelligence


• No access to data, no machine learning


• No access to data, data Science department will not like you


• No access to data, you cannot be a digital company


Integrate with devices


Bring the relevant data where the user is


Integrate with other cloud services / applications
Why Open up your data “securely”
Introduction to SpringBatch
• Why open up your data


• What is Spring and SpringBatch


• Demo project - Let’s build something


• Closing thoughts


• Q/A
Agenda
Introduction to SpringBatch
https://spring.io/projects
https://spring.io/learn
https://spring.io/guides
*New => https://spring.io/guides/gs/gateway/
• Spring started as an
open source project,
now called ‘Spring
Core Container’


• Spring the company
then started tackling
other common
application needs
such as data, web,
security to name a
few.
Introduction to SpringBatch
• It is a Java project built on top of Spring Core Framework


• It is a stand alone application that can run anywhere there is a
Java JVM.


• It moves data between data sources in a consistent manner


• It has its own database schema to track its work (H2 default)


• It allows manipulating data “processing” between source and
destination
https://spring.io/projects/spring-batch
So what is the SpringBatch project?
Introduction to SpringBatch
• We put our code in specific places and the framework calls our
code.
How does SpringBatch work?
App
Starts
Application
Context
Created
Similar to JSF/
XPages
managed
beans, spring
core will scan all
java classes and
load them into
a global scoped
memory space
Configurations
are run
JDBC


Message Queue


Features


Schedulers


HTTP Server




Depends on
config the what
SpringBatch


Starts a Job
Step1
Optional
Processor
Step 2
Step N
Run
next step?
Run
next step?
App
Ends
JVM runs
main() method
typical Java
application
A job instance is
created and
based on how
job is
assembled all
the steps are
run. Optionally
a processor to
change data.
A processor can
be shared /
reused by other
jobs.
Every step of
the way the
framework is
logging activity
and placing
breadcrumbs
where it is in
the batch
process to the
SQL db.
Introduction to SpringBatch
https://docs.spring.io/spring-batch/docs/current/reference/html/index-single.html#meta DataSchemaOverview
Restartability


Restart a job and continue where it left off.


Intercepting Job Execution


Lifecycle events beforeJob,afterJob


JobParameters


Send parameters and param validation


Chunk Processing


Processes data sets in chunks [a]synchronously


Step Flows; skips, retry


Chaining steps into flows; conditional forking steps


Rollback
Introduction to SpringBatch
• Why open up your data


• What is Spring and SpringBatch


• Demo project - Let’s build something


• Closing thoughts


• Q/A
Agenda
Introduction to SpringBatch
• We will import a Lego Parts list ~37K records from CSV


• We will use last years session model objects


• We will use a NoSQL JSON Document repository (storage)


• The only less experimental option is using Domino Data Access Services.
Let’s put together a SpringBatch app that imports from a CSV into a Database
https://youtu.be/JY_KOfHJk8w
See Collabsphere 2020 Presentation…
Introduction to SpringBatch
• Install MongoDB


$> brew tap mongodb/brew


$> brew install mongodb/brew/mongodb-community@5.0


• Uninstall Mongo


$> brew uninstall mongodb-community


• Staring MongoDB


$> brew services start mongodb-community@5.0


$> brew services stop mongodb-community@5.0


* In MongoDB Shell Client ‘shell> shutdown’


$> brew services list


$> mongotop //db tools command line (backup/import/export, monitoring, similar to Admin client)


$> mongsh //test queries and db operations
Let’s use a NoSQL JSON document store
No salesmen


No websites


No registration


It works out of the box
Introduction to SpringBatch
• Start SpringBoot initialize


Web: https://start.spring.io


IDE: IntelliJ or Eclipse


• Fill out the form, select the


dependencies and finally


‘Generate’ to download a


starter project.


• No account or login required.


Recipe: Start a project 1 of 4
Introduction to SpringBatch
• Use your favorite IDE to open the project.


• Add a CSV file to the resources folder (lego parts 43,695 rows)


• Add H2 and Mongo connection info application.properties


• Add packages config, controller, launcher, model


• Add Model objects or import them as dependency
Recipe: preparation 2 of 4
Introduction to SpringBatch
• Add LegoBatchConfig class


• annotate @Configuration, @EnableBatchProcessing


• Add a ItemReader<YourPojo>


• Add a ItemWriter ‘new MongoItmWriter<>()’ built in.


• Add one or more steps


• Add one or more jobs
Recipe: Job Configuration 3 of 4
Introduction to SpringBatch
• Add a JobLauncher class and implement CommandLineRunner


• Call jobLauncher.run; pass in a job, and a unique job id.


• Run the application




If Port is being used by another application.


$> lsof -i :8080 | grep LISTEN


application.properties > server.port={newport}




Open H2 Web Console to see Job status


http://localhost:8080/h2/


select ji.JOB_INSTANCE_ID, ji.JOB_NAME,


je.CREATE_TIME, je.START_TIME, je.END_TIME, je.STATUS, je.END_TIME - je.START_TIME, je.EXIT_CODE,


se.STEP_NAME, se.READ_COUNT, se.WRITE_COUNT, se.END_TIME - se.START_TIME


from BATCH_JOB_INSTANCE ji


join BATCH_JOB_EXECUTION je on je.JOB_INSTANCE_ID = ji.JOB_INSTANCE_ID


Join BATCH_STEP_EXECUTION se on se.JOB_EXECUTION_ID = je.JOB_EXECUTION_ID;




MongoDB Shell Commands


show databases; //view all databases. Similar to showing all NSF files.


Use bricks; //select a database to work with. Like opening a Notes database.


db.parts.drop(); //remove a collection. Like deleting a Notes View.
Recipe: Create a Job Launcher 4 of 4
Introduction to SpringBatch
• Similar to a Domino Agent Manager; bonus, can be debugged easily.


• Add an annotation @EnableScheduling to LegoJobLauncher


• Add an annotation @Scheduled(cron = “0 */1 * * * ?”) to run the
job Launcher.




Mongo DB Commands


db.parts.count();


db.parts.find(); //get a collection, then it for more to page through.


db.parts.find({partNum: “10178pr0004"}); //optional .limit(5)


Recipe: Add Scheduler - Spring TaskScheduler Project
Introduction to SpringBatch
• Add a JobController class in the controller package.


• Annotate with @RestController, @RestMapping(“/api/job”)


• Autowire the LegoJobLauncher


• Add a method for POST to call legoJobLauncher.run()
Recipe: Add REST Controller - Spring Web Project
Introduction to SpringBatch
• Why open up your data


• What is Spring and SpringBatch


• Demo project - Let’s build something


• Closing thoughts


• Q/A
Agenda
Introduction to SpringBatch
Technology Review : Challenges with Domino as NoSQL Storage


Domino

• Standing up a server is difficult on a developer’s workstation.

• Developers have to use a MS Windows workstation.

• Domino is not designed for a NoSQL storage service.

• Domino is not integrated into other echo systems like Java and .NET Core libraries.

• NSF is a key value pair flat document store.

• Once installed, Domino is not configured as a NoSQL storage service (DAS) turned off.

Domino Data Access (Production ready REST API)

• DAS REST API does not handle complete JSON schemas, only array of key value pairs.

• DAS needs a middleware, like SpringBoot to validate and insert data into documents and response documents.

• Hidden features: default has limitation on retrieved documents. We do not get all the data requested. Notes.ini

• Uses Vectors instead of Java 8 streams.

Beta Projects to watch

• KEEP A middleware, RESTful way to access Domino backend; Domino Docker image on MacBook and install
challenges because there is no Domino Administrator to continue server setup, maybe next year.
Introduction to SpringBatch
Technology Review : Designed and build for NoSQL Storage


Source: https://en.wikipedia.org/wiki/NoSQL
Note: CouchDb inspired by Lotus Notes… Damian Katz Ex Iris engineer.
Intro to Microservices with Domino Use Case
Have fun exploring SpringBatch


Twitter: @XPagesBeast


LinkedIn: https://www.linkedin.com/in/slobodanlohja/





Samples: https://github.com/spring-projects/spring-batch/tree/main/spring-batch-samples
Thank You !

More Related Content

What's hot

Building ColdFusion And AngularJS Applications
Building ColdFusion And AngularJS ApplicationsBuilding ColdFusion And AngularJS Applications
Building ColdFusion And AngularJS ApplicationsColdFusionConference
 
Alfresco Digital Business Platform Builder Experience
Alfresco Digital Business Platform Builder ExperienceAlfresco Digital Business Platform Builder Experience
Alfresco Digital Business Platform Builder ExperienceRay Gauss
 
White Paper : ASP.NET Core AngularJs 2 and Prime
White Paper : ASP.NET Core AngularJs 2 and PrimeWhite Paper : ASP.NET Core AngularJs 2 and Prime
White Paper : ASP.NET Core AngularJs 2 and PrimeHamida Rebai Trabelsi
 
O365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialO365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialThomas Daly
 
12-factor-jruby
12-factor-jruby12-factor-jruby
12-factor-jrubyJoe Kutner
 
Practical Application of API-First in microservices development
Practical Application of API-First in microservices developmentPractical Application of API-First in microservices development
Practical Application of API-First in microservices developmentChavdar Baikov
 
Salesforce Lightning workshop Hartford - 12 March
Salesforce Lightning workshop Hartford - 12 MarchSalesforce Lightning workshop Hartford - 12 March
Salesforce Lightning workshop Hartford - 12 MarchJitendra Zaa
 
The web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go - IstanbulThe web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go - IstanbulRobert Nyman
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...Mark Leusink
 
Java EE8 - by Kito Mann
Java EE8 - by Kito Mann Java EE8 - by Kito Mann
Java EE8 - by Kito Mann Kile Niklawski
 
Building Quality into the AEM Publication Workflow with Active Standards by D...
Building Quality into the AEM Publication Workflow with Active Standards by D...Building Quality into the AEM Publication Workflow with Active Standards by D...
Building Quality into the AEM Publication Workflow with Active Standards by D...AEM HUB
 
Content migration for sitecore
Content migration for sitecoreContent migration for sitecore
Content migration for sitecoreSurendra Sharma
 
Practical management of development & QA environments for SharePoint 2013
Practical management of development & QA environments for SharePoint 2013Practical management of development & QA environments for SharePoint 2013
Practical management of development & QA environments for SharePoint 2013SharePointRadi
 
Enterprise Architectures with Ruby (and Rails)
Enterprise Architectures with Ruby (and Rails)Enterprise Architectures with Ruby (and Rails)
Enterprise Architectures with Ruby (and Rails)Konstantin Gredeskoul
 
ECS19 - Nik Charlebois - Automate the Deployment & Monitoring of SharePoint w...
ECS19 - Nik Charlebois - Automate the Deployment & Monitoring of SharePoint w...ECS19 - Nik Charlebois - Automate the Deployment & Monitoring of SharePoint w...
ECS19 - Nik Charlebois - Automate the Deployment & Monitoring of SharePoint w...European Collaboration Summit
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NETPeter Gfader
 
Process Orchestration with Flowable and Spring Boot
Process Orchestration with Flowable and Spring BootProcess Orchestration with Flowable and Spring Boot
Process Orchestration with Flowable and Spring BootChavdar Baikov
 
Web, Mobile, App and Back!
Web, Mobile, App and Back!Web, Mobile, App and Back!
Web, Mobile, App and Back!Gabriel Walt
 

What's hot (20)

Building ColdFusion And AngularJS Applications
Building ColdFusion And AngularJS ApplicationsBuilding ColdFusion And AngularJS Applications
Building ColdFusion And AngularJS Applications
 
Alfresco Digital Business Platform Builder Experience
Alfresco Digital Business Platform Builder ExperienceAlfresco Digital Business Platform Builder Experience
Alfresco Digital Business Platform Builder Experience
 
White Paper : ASP.NET Core AngularJs 2 and Prime
White Paper : ASP.NET Core AngularJs 2 and PrimeWhite Paper : ASP.NET Core AngularJs 2 and Prime
White Paper : ASP.NET Core AngularJs 2 and Prime
 
O365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - MaterialO365 Developer Bootcamp NJ 2018 - Material
O365 Developer Bootcamp NJ 2018 - Material
 
12-factor-jruby
12-factor-jruby12-factor-jruby
12-factor-jruby
 
Practical Application of API-First in microservices development
Practical Application of API-First in microservices developmentPractical Application of API-First in microservices development
Practical Application of API-First in microservices development
 
Salesforce Lightning workshop Hartford - 12 March
Salesforce Lightning workshop Hartford - 12 MarchSalesforce Lightning workshop Hartford - 12 March
Salesforce Lightning workshop Hartford - 12 March
 
The web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go - IstanbulThe web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go - Istanbul
 
The future of web development write once, run everywhere with angular js an...
The future of web development   write once, run everywhere with angular js an...The future of web development   write once, run everywhere with angular js an...
The future of web development write once, run everywhere with angular js an...
 
GraphQL 101
GraphQL 101GraphQL 101
GraphQL 101
 
Java EE8 - by Kito Mann
Java EE8 - by Kito Mann Java EE8 - by Kito Mann
Java EE8 - by Kito Mann
 
Building Quality into the AEM Publication Workflow with Active Standards by D...
Building Quality into the AEM Publication Workflow with Active Standards by D...Building Quality into the AEM Publication Workflow with Active Standards by D...
Building Quality into the AEM Publication Workflow with Active Standards by D...
 
Content migration for sitecore
Content migration for sitecoreContent migration for sitecore
Content migration for sitecore
 
Practical management of development & QA environments for SharePoint 2013
Practical management of development & QA environments for SharePoint 2013Practical management of development & QA environments for SharePoint 2013
Practical management of development & QA environments for SharePoint 2013
 
Enterprise Architectures with Ruby (and Rails)
Enterprise Architectures with Ruby (and Rails)Enterprise Architectures with Ruby (and Rails)
Enterprise Architectures with Ruby (and Rails)
 
ECS19 - Nik Charlebois - Automate the Deployment & Monitoring of SharePoint w...
ECS19 - Nik Charlebois - Automate the Deployment & Monitoring of SharePoint w...ECS19 - Nik Charlebois - Automate the Deployment & Monitoring of SharePoint w...
ECS19 - Nik Charlebois - Automate the Deployment & Monitoring of SharePoint w...
 
Test Policy and Practices
Test Policy and PracticesTest Policy and Practices
Test Policy and Practices
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
Process Orchestration with Flowable and Spring Boot
Process Orchestration with Flowable and Spring BootProcess Orchestration with Flowable and Spring Boot
Process Orchestration with Flowable and Spring Boot
 
Web, Mobile, App and Back!
Web, Mobile, App and Back!Web, Mobile, App and Back!
Web, Mobile, App and Back!
 

Similar to Intro to SpringBatch NoSQL 2021

Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applicationshchen1
 
Proper Connections Development for Proper Domino Developers
Proper Connections Development for Proper Domino DevelopersProper Connections Development for Proper Domino Developers
Proper Connections Development for Proper Domino DevelopersMark Myers
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2divzi1913
 
Spring Boot Whirlwind Tour
Spring Boot Whirlwind TourSpring Boot Whirlwind Tour
Spring Boot Whirlwind TourVMware Tanzu
 
Introduction to react native with redux
Introduction to react native with reduxIntroduction to react native with redux
Introduction to react native with reduxMike Melusky
 
Advanced web application architecture - Talk
Advanced web application architecture - TalkAdvanced web application architecture - Talk
Advanced web application architecture - TalkMatthias Noback
 
Reactive application using meteor
Reactive application using meteorReactive application using meteor
Reactive application using meteorSapna Upreti
 
Spring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applicationsSpring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applicationsmichaelaaron25322
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2Long Nguyen
 
Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst
Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirstBuilding CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst
Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirstJun-ichi Sakamoto
 
What is Node.js? (ICON UK)
What is Node.js? (ICON UK)What is Node.js? (ICON UK)
What is Node.js? (ICON UK)Tim Davis
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...Malin Weiss
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...Speedment, Inc.
 
BITM3730Week12.pptx
BITM3730Week12.pptxBITM3730Week12.pptx
BITM3730Week12.pptxMattMarino13
 
SOA Knowledge Kit, Developer Productivity and Performance Comparison Analysis
SOA Knowledge Kit, Developer Productivity  and Performance Comparison AnalysisSOA Knowledge Kit, Developer Productivity  and Performance Comparison Analysis
SOA Knowledge Kit, Developer Productivity and Performance Comparison AnalysisClever Moe
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdfNode.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdflubnayasminsebl
 
Introduction To Code Igniter
Introduction To Code IgniterIntroduction To Code Igniter
Introduction To Code IgniterAmzad Hossain
 

Similar to Intro to SpringBatch NoSQL 2021 (20)

Developing Java Web Applications
Developing Java Web ApplicationsDeveloping Java Web Applications
Developing Java Web Applications
 
Proper Connections Development for Proper Domino Developers
Proper Connections Development for Proper Domino DevelopersProper Connections Development for Proper Domino Developers
Proper Connections Development for Proper Domino Developers
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2
 
Spring Boot Whirlwind Tour
Spring Boot Whirlwind TourSpring Boot Whirlwind Tour
Spring Boot Whirlwind Tour
 
Introduction to react native with redux
Introduction to react native with reduxIntroduction to react native with redux
Introduction to react native with redux
 
Advanced web application architecture - Talk
Advanced web application architecture - TalkAdvanced web application architecture - Talk
Advanced web application architecture - Talk
 
Nodejs
NodejsNodejs
Nodejs
 
Reactive application using meteor
Reactive application using meteorReactive application using meteor
Reactive application using meteor
 
Spring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applicationsSpring data jpa are used to develop spring applications
Spring data jpa are used to develop spring applications
 
Struts 2-overview2
Struts 2-overview2Struts 2-overview2
Struts 2-overview2
 
Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst
Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirstBuilding CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst
Building CLR/H Registration Site with ASP.NET MVC4 and EF4CodeFirst
 
What is Node.js? (ICON UK)
What is Node.js? (ICON UK)What is Node.js? (ICON UK)
What is Node.js? (ICON UK)
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
 
BITM3730Week12.pptx
BITM3730Week12.pptxBITM3730Week12.pptx
BITM3730Week12.pptx
 
SOA Knowledge Kit, Developer Productivity and Performance Comparison Analysis
SOA Knowledge Kit, Developer Productivity  and Performance Comparison AnalysisSOA Knowledge Kit, Developer Productivity  and Performance Comparison Analysis
SOA Knowledge Kit, Developer Productivity and Performance Comparison Analysis
 
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdfNode.js and the MEAN Stack Building Full-Stack Web Applications.pdf
Node.js and the MEAN Stack Building Full-Stack Web Applications.pdf
 
Dust.js
Dust.jsDust.js
Dust.js
 
Introduction To Code Igniter
Introduction To Code IgniterIntroduction To Code Igniter
Introduction To Code Igniter
 
Midao JDBC presentation
Midao JDBC presentationMidao JDBC presentation
Midao JDBC presentation
 

More from Slobodan Lohja

Domino on docker version 2
Domino on docker version 2Domino on docker version 2
Domino on docker version 2Slobodan Lohja
 
JSF ActionListeners with XPages and Java Debugging XPages
JSF ActionListeners with XPages and Java Debugging XPagesJSF ActionListeners with XPages and Java Debugging XPages
JSF ActionListeners with XPages and Java Debugging XPagesSlobodan Lohja
 
How to adopt team development and source control rev2
How to adopt team development and source control rev2How to adopt team development and source control rev2
How to adopt team development and source control rev2Slobodan Lohja
 
Domino on docker version 1
Domino on docker version 1Domino on docker version 1
Domino on docker version 1Slobodan Lohja
 
Git for IBM Notes Designer
Git for IBM Notes DesignerGit for IBM Notes Designer
Git for IBM Notes DesignerSlobodan Lohja
 

More from Slobodan Lohja (6)

Domino on docker version 2
Domino on docker version 2Domino on docker version 2
Domino on docker version 2
 
Automated ui-testing
Automated ui-testingAutomated ui-testing
Automated ui-testing
 
JSF ActionListeners with XPages and Java Debugging XPages
JSF ActionListeners with XPages and Java Debugging XPagesJSF ActionListeners with XPages and Java Debugging XPages
JSF ActionListeners with XPages and Java Debugging XPages
 
How to adopt team development and source control rev2
How to adopt team development and source control rev2How to adopt team development and source control rev2
How to adopt team development and source control rev2
 
Domino on docker version 1
Domino on docker version 1Domino on docker version 1
Domino on docker version 1
 
Git for IBM Notes Designer
Git for IBM Notes DesignerGit for IBM Notes Designer
Git for IBM Notes Designer
 

Recently uploaded

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 

Recently uploaded (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 

Intro to SpringBatch NoSQL 2021

  • 1. Data is the new oil Introduction to SpringBatch Presentation by Slobodan Lohja 2021 Photo illustration by Slate
  • 2. Introduction to SpringBatch Thank you to our sponsors!
  • 3. • Certi fi ed IBM Application Developer for Collaboration (Lotus Domino). • 20[18,19,20,21] Collabsphere Speaker • 2019 IBM Think Speaker • 20[19,20,21] Senior Developer and technical team lead to modernize mainframe apps to SpringBoot Microservices for insurance claim processing • 2021 Developer Specialist; Full stack. REACT/SpringBoot modernization of JSP monolith Websphere application. Introduction to SpringBatch Slobodan Lohja https://www.linkedin.com/in/slobodanlohja/
  • 4. Introduction to SpringBatch • Why open up your data • What is Spring and SpringBatch • Demo project - Let’s build something • Closing thoughts • Q/A Agenda
  • 5. Introduction to SpringBatch • No access to data, no business intelligence • No access to data, no artificial intelligence • No access to data, no machine learning • No access to data, data Science department will not like you • No access to data, you cannot be a digital company Integrate with devices Bring the relevant data where the user is Integrate with other cloud services / applications Why Open up your data “securely”
  • 6. Introduction to SpringBatch • Why open up your data • What is Spring and SpringBatch • Demo project - Let’s build something • Closing thoughts • Q/A Agenda
  • 7. Introduction to SpringBatch https://spring.io/projects https://spring.io/learn https://spring.io/guides *New => https://spring.io/guides/gs/gateway/ • Spring started as an open source project, now called ‘Spring Core Container’ • Spring the company then started tackling other common application needs such as data, web, security to name a few.
  • 8. Introduction to SpringBatch • It is a Java project built on top of Spring Core Framework • It is a stand alone application that can run anywhere there is a Java JVM. • It moves data between data sources in a consistent manner • It has its own database schema to track its work (H2 default) • It allows manipulating data “processing” between source and destination https://spring.io/projects/spring-batch So what is the SpringBatch project?
  • 9. Introduction to SpringBatch • We put our code in specific places and the framework calls our code. How does SpringBatch work? App Starts Application Context Created Similar to JSF/ XPages managed beans, spring core will scan all java classes and load them into a global scoped memory space Configurations are run JDBC 
 Message Queue 
 Features 
 Schedulers 
 HTTP Server 
 
 Depends on config the what SpringBatch Starts a Job Step1 Optional Processor Step 2 Step N Run next step? Run next step? App Ends JVM runs main() method typical Java application A job instance is created and based on how job is assembled all the steps are run. Optionally a processor to change data. A processor can be shared / reused by other jobs. Every step of the way the framework is logging activity and placing breadcrumbs where it is in the batch process to the SQL db.
  • 10. Introduction to SpringBatch https://docs.spring.io/spring-batch/docs/current/reference/html/index-single.html#meta DataSchemaOverview Restartability Restart a job and continue where it left off. Intercepting Job Execution Lifecycle events beforeJob,afterJob JobParameters Send parameters and param validation 
 Chunk Processing Processes data sets in chunks [a]synchronously Step Flows; skips, retry Chaining steps into flows; conditional forking steps 
 Rollback
  • 11. Introduction to SpringBatch • Why open up your data • What is Spring and SpringBatch • Demo project - Let’s build something • Closing thoughts • Q/A Agenda
  • 12. Introduction to SpringBatch • We will import a Lego Parts list ~37K records from CSV • We will use last years session model objects • We will use a NoSQL JSON Document repository (storage) • The only less experimental option is using Domino Data Access Services. Let’s put together a SpringBatch app that imports from a CSV into a Database https://youtu.be/JY_KOfHJk8w See Collabsphere 2020 Presentation…
  • 13. Introduction to SpringBatch • Install MongoDB $> brew tap mongodb/brew 
 $> brew install mongodb/brew/mongodb-community@5.0 • Uninstall Mongo $> brew uninstall mongodb-community • Staring MongoDB $> brew services start mongodb-community@5.0 
 $> brew services stop mongodb-community@5.0 
 * In MongoDB Shell Client ‘shell> shutdown’ $> brew services list 
 $> mongotop //db tools command line (backup/import/export, monitoring, similar to Admin client) 
 $> mongsh //test queries and db operations Let’s use a NoSQL JSON document store No salesmen No websites No registration 
 It works out of the box
  • 14. Introduction to SpringBatch • Start SpringBoot initialize 
 Web: https://start.spring.io 
 IDE: IntelliJ or Eclipse • Fill out the form, select the 
 dependencies and finally 
 ‘Generate’ to download a 
 starter project. • No account or login required. 
 Recipe: Start a project 1 of 4
  • 15. Introduction to SpringBatch • Use your favorite IDE to open the project. • Add a CSV file to the resources folder (lego parts 43,695 rows) • Add H2 and Mongo connection info application.properties • Add packages config, controller, launcher, model • Add Model objects or import them as dependency Recipe: preparation 2 of 4
  • 16. Introduction to SpringBatch • Add LegoBatchConfig class • annotate @Configuration, @EnableBatchProcessing • Add a ItemReader<YourPojo> • Add a ItemWriter ‘new MongoItmWriter<>()’ built in. • Add one or more steps • Add one or more jobs Recipe: Job Configuration 3 of 4
  • 17. Introduction to SpringBatch • Add a JobLauncher class and implement CommandLineRunner • Call jobLauncher.run; pass in a job, and a unique job id. • Run the application 
 If Port is being used by another application. 
 $> lsof -i :8080 | grep LISTEN application.properties > server.port={newport} 
 
 Open H2 Web Console to see Job status 
 http://localhost:8080/h2/ select ji.JOB_INSTANCE_ID, ji.JOB_NAME, je.CREATE_TIME, je.START_TIME, je.END_TIME, je.STATUS, je.END_TIME - je.START_TIME, je.EXIT_CODE, se.STEP_NAME, se.READ_COUNT, se.WRITE_COUNT, se.END_TIME - se.START_TIME from BATCH_JOB_INSTANCE ji join BATCH_JOB_EXECUTION je on je.JOB_INSTANCE_ID = ji.JOB_INSTANCE_ID Join BATCH_STEP_EXECUTION se on se.JOB_EXECUTION_ID = je.JOB_EXECUTION_ID; 
 
 MongoDB Shell Commands 
 show databases; //view all databases. Similar to showing all NSF files. Use bricks; //select a database to work with. Like opening a Notes database. db.parts.drop(); //remove a collection. Like deleting a Notes View. Recipe: Create a Job Launcher 4 of 4
  • 18. Introduction to SpringBatch • Similar to a Domino Agent Manager; bonus, can be debugged easily. • Add an annotation @EnableScheduling to LegoJobLauncher • Add an annotation @Scheduled(cron = “0 */1 * * * ?”) to run the job Launcher. 
 
 Mongo DB Commands 
 db.parts.count(); 
 db.parts.find(); //get a collection, then it for more to page through. 
 db.parts.find({partNum: “10178pr0004"}); //optional .limit(5) 
 Recipe: Add Scheduler - Spring TaskScheduler Project
  • 19. Introduction to SpringBatch • Add a JobController class in the controller package. • Annotate with @RestController, @RestMapping(“/api/job”) • Autowire the LegoJobLauncher • Add a method for POST to call legoJobLauncher.run() Recipe: Add REST Controller - Spring Web Project
  • 20. Introduction to SpringBatch • Why open up your data • What is Spring and SpringBatch • Demo project - Let’s build something • Closing thoughts • Q/A Agenda
  • 21. Introduction to SpringBatch Technology Review : Challenges with Domino as NoSQL Storage Domino • Standing up a server is difficult on a developer’s workstation. • Developers have to use a MS Windows workstation. • Domino is not designed for a NoSQL storage service. • Domino is not integrated into other echo systems like Java and .NET Core libraries. • NSF is a key value pair flat document store. • Once installed, Domino is not configured as a NoSQL storage service (DAS) turned off. Domino Data Access (Production ready REST API) • DAS REST API does not handle complete JSON schemas, only array of key value pairs. • DAS needs a middleware, like SpringBoot to validate and insert data into documents and response documents. • Hidden features: default has limitation on retrieved documents. We do not get all the data requested. Notes.ini • Uses Vectors instead of Java 8 streams. Beta Projects to watch • KEEP A middleware, RESTful way to access Domino backend; Domino Docker image on MacBook and install challenges because there is no Domino Administrator to continue server setup, maybe next year.
  • 22. Introduction to SpringBatch Technology Review : Designed and build for NoSQL Storage Source: https://en.wikipedia.org/wiki/NoSQL Note: CouchDb inspired by Lotus Notes… Damian Katz Ex Iris engineer.
  • 23. Intro to Microservices with Domino Use Case Have fun exploring SpringBatch Twitter: @XPagesBeast LinkedIn: https://www.linkedin.com/in/slobodanlohja/ 

 Samples: https://github.com/spring-projects/spring-batch/tree/main/spring-batch-samples Thank You !