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
330
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Spring Batchの紹介
2018.4.11 社内勉強会で発表した
Spring Batch実行環境のスライド
yutachaos
April 12, 2018
More Decks by yutachaos
See All by yutachaos
JenkinsのJobを CronJobに移した話 /The story of moving Jenkins Job to CronJob
yutachaos
0
260
History of Infrastructure as a Code testing
yutachaos
2
5.6k
AWS CodePipeline 初めて触って少しハマった話 / A story that challenged AWS CodePipeline for the first time
yutachaos
0
130
gRPC in スタディサプリENGLISH / gRPC in StudySapuri ENGLISH
yutachaos
0
3.1k
AKS,EKS,GKEコマンド比較してみた /compared AKS, EKS, GKE command
yutachaos
2
2.6k
AWS ECS の説明 /aws-ecs-introduction
yutachaos
0
140
Docker + Jenkinsでバッチ実行 / Using Docker and Jenkins execution batch
yutachaos
0
290
非エンジニア向けMarkdown 勉強会
yutachaos
1
500
Circle CI 入門
yutachaos
0
770
Other Decks in Technology
See All in Technology
社内の7割が使うデータ基盤を、 データチーム2人で回すためにやったこと
koh_yoshi
4
1.5k
Genie Codeハンズオン応用編
taka_aki
0
140
Invisible to AI? Making TYPO3 Sites Quotable by AI Search Systems
wolfgangwagner
0
250
FDEの心得
noriakioji
5
6.4k
FORENSIA: ローカルLLMフォレンジックハーネス
sumeshi
2
440
巨大気象データと戦う ― サロゲートモデル学習を高速化する圧縮技術
gpuunite_official
0
250
平文パスワードはログに“残り” ── 肝心の侵入は“痕跡すら残らない”
kuroneko13
0
120
コーチングの奥義 何もしないテクニック
jinwatanabe
0
150
なぜ Temporal の大小比較には compare しかないのか / Why Does Temporal Only Have compare() for Comparisons
kazukihayase
1
200
現場回帰したデータエンジニアが考える AI 時代のキャリア開発 / Career Development in the Age of AI Perspectives from a Hands-on Data Engineer
medley
0
310
Rust×eBPFでEDRっぽいものをつくる
sunlife3
2
850
生成 AI の基礎 〜 サンプル実装で学ぶ基本原理
enakai00
7
4.6k
Featured
See All Featured
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
340
Ruling the World: When Life Gets Gamed
codingconduct
0
310
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
The untapped power of vector embeddings
frankvandijk
2
1.8k
Facilitating Awesome Meetings
lara
57
7.1k
How to Talk to Developers About Accessibility
jct
2
520
We Have a Design System, Now What?
morganepeng
55
8.3k
The Mindset for Success: Future Career Progression
greggifford
PRO
0
470
The Cult of Friendly URLs
andyhume
79
7k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
470
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
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