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
250
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
180
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
85
gRPC in スタディサプリENGLISH / gRPC in StudySapuri ENGLISH
yutachaos
0
2.7k
AKS,EKS,GKEコマンド比較してみた /compared AKS, EKS, GKE command
yutachaos
2
2.3k
AWS ECS の説明 /aws-ecs-introduction
yutachaos
0
81
Docker + Jenkinsでバッチ実行 / Using Docker and Jenkins execution batch
yutachaos
0
250
非エンジニア向けMarkdown 勉強会
yutachaos
1
300
Circle CI 入門
yutachaos
0
630
Other Decks in Technology
See All in Technology
誰も全体を知らない ~ ロールの垣根を超えて引き上げる開発生産性 / Boosting Development Productivity Across Roles
kakehashi
1
230
The Role of Developer Relations in AI Product Success.
giftojabu1
0
130
rootlessコンテナのすゝめ - 研究室サーバーでもできる安全なコンテナ管理
kitsuya0828
3
390
強いチームと開発生産性
onk
PRO
34
11k
EventHub Startup CTO of the year 2024 ピッチ資料
eventhub
0
120
ノーコードデータ分析ツールで体験する時系列データ分析超入門
negi111111
0
410
AWS Lambdaと歩んだ“サーバーレス”と今後 #lambda_10years
yoshidashingo
1
170
障害対応指揮の意思決定と情報共有における価値観 / Waroom Meetup #2
arthur1
5
480
Incident Response Practices: Waroom's Features and Future Challenges
rrreeeyyy
0
160
スクラムチームを立ち上げる〜チーム開発で得られたもの・得られなかったもの〜
ohnoeight
2
350
Security-JAWS【第35回】勉強会クラウドにおけるマルウェアやコンテンツ改ざんへの対策
4su_para
0
180
AIチャットボット開発への生成AI活用
ryomrt
0
170
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Why Our Code Smells
bkeepers
PRO
334
57k
Reflections from 52 weeks, 52 projects
jeffersonlam
346
20k
A better future with KSS
kneath
238
17k
We Have a Design System, Now What?
morganepeng
50
7.2k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
KATA
mclloyd
29
14k
Making Projects Easy
brettharned
115
5.9k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
364
24k
A Tale of Four Properties
chriscoyier
156
23k
Become a Pro
speakerdeck
PRO
25
5k
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