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
Terraform Stacks入門 #HashiTalks
msato
0
360
Lambdaと地方とコミュニティ
miu_crescent
2
370
IBC 2024 動画技術関連レポート / IBC 2024 Report
cyberagentdevelopers
PRO
1
110
The Rise of LLMOps
asei
7
1.7k
AGIについてChatGPTに聞いてみた
blueb
0
130
100 名超が参加した日経グループ横断の競技型 AWS 学習イベント「Nikkei Group AWS GameDay」の紹介/mediajaws202411
nikkei_engineer_recruiting
1
170
OCI Security サービス 概要
oracle4engineer
PRO
0
6.5k
Shopifyアプリ開発における Shopifyの機能活用
sonatard
4
250
飲食店データの分析事例とそれを支えるデータ基盤
kimujun
0
150
ドメインの本質を掴む / Get the essence of the domain
sinsoku
2
160
Python(PYNQ)がテーマのAMD主催のFPGAコンテストに参加してきた
iotengineer22
0
500
Incident Response Practices: Waroom's Features and Future Challenges
rrreeeyyy
0
160
Featured
See All Featured
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Writing Fast Ruby
sferik
627
61k
It's Worth the Effort
3n
183
27k
Gamification - CAS2011
davidbonilla
80
5k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Optimizing for Happiness
mojombo
376
70k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
28
2k
Building Adaptive Systems
keathley
38
2.3k
Music & Morning Musume
bryan
46
6.2k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
Speed Design
sergeychernyshev
25
620
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