Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Spring Batchの紹介
Search
yutachaos
April 12, 2018
Technology
0
260
Spring Batchの紹介
2018.4.11 社内勉強会で発表した
Spring Batch実行環境のスライド
yutachaos
April 12, 2018
Tweet
Share
More Decks by yutachaos
See All by yutachaos
JenkinsのJobを CronJobに移した話 /The story of moving Jenkins Job to CronJob
yutachaos
0
190
History of Infrastructure as a Code testing
yutachaos
2
5.2k
AWS CodePipeline 初めて触って少しハマった話 / A story that challenged AWS CodePipeline for the first time
yutachaos
0
86
gRPC in スタディサプリENGLISH / gRPC in StudySapuri ENGLISH
yutachaos
0
2.8k
AKS,EKS,GKEコマンド比較してみた /compared AKS, EKS, GKE command
yutachaos
2
2.3k
AWS ECS の説明 /aws-ecs-introduction
yutachaos
0
83
Docker + Jenkinsでバッチ実行 / Using Docker and Jenkins execution batch
yutachaos
0
250
非エンジニア向けMarkdown 勉強会
yutachaos
1
320
Circle CI 入門
yutachaos
0
650
Other Decks in Technology
See All in Technology
なぜfreeeはハブ・アンド・スポーク型の データメッシュアーキテクチャにチャレンジするのか?
shinichiro_joya
2
490
月間60万ユーザーを抱える 個人開発サービス「Walica」の 技術スタック変遷
miyachin
1
140
Formal Development of Operating Systems in Rust
riru
1
420
WantedlyでのKotlin Multiplatformの導入と課題 / Kotlin Multiplatform Implementation and Challenges at Wantedly
kubode
0
250
Cloudflareで実現する AIエージェント ワークフロー基盤
kmd09
0
290
Amazon Q Developerで.NET Frameworkプロジェクトをモダナイズしてみた
kenichirokimura
1
200
カップ麺の待ち時間(3分)でわかるPartyRockアップデート
ryutakondo
0
140
2024AWSで個人的にアツかったアップデート
nagisa53
1
110
ABWGのRe:Cap!
hm5ug
1
120
dbtを中心にして組織のアジリティとガバナンスのトレードオンを考えてみた
gappy50
0
280
新卒1年目、はじめてのアプリケーションサーバー【IBM WebSphere Liberty】
ktgrryt
0
130
Evolving Architecture
rainerhahnekamp
3
260
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Statistics for Hackers
jakevdp
797
220k
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
KATA
mclloyd
29
14k
RailsConf 2023
tenderlove
29
970
Fireside Chat
paigeccino
34
3.1k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
570
Transcript
Spring Batch ղઆ 2018/4/11 ଜ༐ଠ
AGENDA • Spring Batchͱ • Ϣʔεέʔε • ΞʔΩςΫνϟ • ·ͱΊɹ
Spring Batchͱ • Java • Spring ProjectͷBatch͚ͷϑϨʔϜϫʔΫ • SpringͷDIίϯςφɺAOPɺτϥϯβΫγϣϯػೳΛϕʔεʹ࡞ ͞Ε͍ͯΔ
ϩΰ
SpringΛCOREͱͨ͠ɺJavaͷEnterprise͚ͷιϑτΣΞ Spring Projectͱ • Spring Boot • Spring Batch •
Spring Framework • Spring Cloud • Spring Shell • Spring Social • Spring LADP • ɾɾɾetc ͍ͬͺ͍͋Γ·͢ɻ
Ϣʔεέʔε • େྔσʔλͷBatchॲཧ • ༷ʑͳϦιʔεʹରԠ • DB, S3, http(s), fileͳͲSpringͷResourceLoaderͷࢿ࢈͕͑Δ
• ܗࣜ • CSV, TSV, json ,DBͳͲΛmappingͯ͠ϑΝΠϧʹಡΈࠐΈରԠՄ ೳ
Spring Batch ΞʔΩςΫνϟ
Spring Batch ղઆ 1 • JobશମͷྲྀΕJobRepository͕ཧ • Job͕1ͭͷେ͖ͳॲཧΛཧ • StepͷॲཧݻఆׂɺಈతʹՄมׂͷ୯ҐͰฒߦॲཧΛߦ͏
͜ͱ͕ग़དྷΔɻ
Spring Batch StepΞʔΩςΫνϟ(Chunk)
Spring Batch StepΞʔΩςΫνϟ(Tasklet)
Spring Batch ղઆ 2 • ॲཧϞσϧ • Chunk • Ұఆ݅ͷσʔλ͝ͱʹ·ͱΊͯͷread(ಡΈࠐΈ)ɺprocess(Ճ)ɺ
write(ॻ͖ࠐΈ)ͷྲྀΕͰॲཧ͢ΔํࣜɻॲཧͷྲྀΕΛఆܕԽ͠ɺ Ұ෦Λ ࣮͢Δ͚ͩͰδϣϒ͕࣮Ͱ͖Δɻ • Tasklet • ࣗ༝ʹॲཧΛهड़͢ΔํࣜͰ͋ΔɻSQLΛ1ճൃߦ͢Δ͚ͩɺίϚϯυΛ ൃߦ͢Δ͚ͩɺͱ͍ͬͨ؆ૉͳέʔε ෳͷσʔλϕʔεϑΝΠϧʹ ΞΫηε͠ͳ͕Βॲཧ͢ΔΑ͏ͳෳࡶͰఆܕԽ͠ʹ͍͘έʔεͰ༻͍Δɻ
KFCͷ߹ Spring Batch ར༻ྫ • େ͖͚ͯ͘ɺ2ͭͷॲཧ • ूܭ͞ΕͨσʔλΛϚΠϧσʔλͷDBʹInsert͢Δ (ॲཧ1) •
ूܭ͞ΕͨσʔλΛར༻ͯ͠ɺpush௨ͷͨΊͷAPI callͱΞϓϦ ଆͷDBͷߋ৽ (ॲཧ2) • ࣮ߦํ๏ • JenkinsΛJob Schedulerʹར༻͠ɺίϚϯυϥΠϯͰ࣮ߦ
·ͱΊ • σϝϦοτ • JavaɺSpringͷ͕ࣝඞཁ • Springࣗମͷίʔυϕʔε͕େͳͷͰɺSpringͷ෦·ͰೖΓࠐΜ ͩʹରԠͮ͠Β͍ɻ • ϝϦοτ
• Springͷࢿ࢈͕ར༻ग़དྷΔͷͰɺใ͕ଟ͍ɻ • ࠶࣮ߦɺฒྻॲཧɺޭɾࣦഊͳͲͷॲཧϑϩʔ͕طʹFWʹؚ·Εͯ ͍ΔͷͰɺ৺͢Δ͜ͱ͕গͳͯ͘ࡁΉ
͓ΘΓ
• ࢀߟจݙ • Macchinetta Batch Framework Development Guideline • TERASOLUNA
Batch Framework for Java (5.x) Development Guideline • 20170525 jsug όονຯ͕ͩʹཱͭ • https://www.slideshare.net/HasegawaDanna1/20170525-jsug