SlideShare a Scribd company logo
Java 
EE 
7 
Batch 
Processing 
in 
the 
Real 
World 
Roberto 
Cortez 
& 
Ivan 
St. 
Ivanov 
JavaOne 
2014 
#CON2818
Who 
are 
we? 
Roberto 
Cortez 
@radcortez 
h/p://www.radcortez.com 
Freelancer, 
Speaker, 
RebelLabs 
Author, 
Blogger 
Ivan 
St. 
Ivanov 
@ivan_stefanov 
h/p://nosoGskills.com 
Architect, 
SAP 
Labs 
Bulgaria, 
JBoss 
Forge 
contributor
QuesHons? 
As 
soon 
as 
you 
have 
them!
What 
is 
Batch? 
“A 
group 
of 
records 
processed 
as 
a 
single 
unit, 
usually 
without 
input 
from 
a 
user.” 
(from 
Google)
Why 
Batch? 
(Computers) 
• Make 
use 
of 
idle 
resources 
• ShiT 
the 
Hme 
of 
processing 
• Manage 
large 
repeated 
work 
easily 
• Shared 
by 
mulHple 
users
Batch 
is 
in 
our 
lives 
• By 
paying 
bills 
• On 
the 
grocery 
• In 
traffic 
• Cooking 
food
Why 
Batch? 
(General) 
• Efficiency 
• Focus 
on 
a 
single 
problem 
• Avoid 
context 
switch 
• Reduce 
costs
State 
of 
the 
Art 
• Spring 
Batch 
• IBM 
Websphere 
• Hadoop 
• Java 
SE, 
Scheduler, 
in-­‐house 
frameworks
The 
JSR-­‐352 
• Batch 
ApplicaHons 
for 
the 
Java 
pla]orm 
• Heavily 
inspired 
by 
Spring 
Batch 
• Available 
since 
Java 
EE 
7 
• Also 
designed 
for 
Java 
SE
The 
JSR-­‐352 
Features 
• Task 
and 
Chunk 
oriented 
processing 
• SequenHal 
and/or 
Parallel 
execuHon 
• CheckpoinHng 
• Workflow 
• Stop 
and 
restart 
• ExcepHon 
handling
Batch 
Domain 
Language 
Job 
Operator 
Job 
Step 
Job 
Repository 
Item 
Reader 
Item 
Processor 
Item 
Writer 
1 
*
Job 
composiYon 
* 
Job 
Step 
* 
JobInstance 
* 
* 
* 
JobExecuYon 
StepExecuYon
Java 
EE 
Batch 
API
Batchlet 
DefiniYon 
@Named 
public 
class 
MyBatchlet 
extends 
AbstractBatchlet 
{ 
@Override 
public 
String 
process() 
{ 
System.out.println("Running 
inside 
a 
batchlet"); 
return 
BatchStatus.COMPLETED.toString(); 
} 
}
Job 
SpecificaYon 
Language 
<job 
id="myFirstBatch"> 
<step 
id="myStep" 
> 
<batchlet 
ref="myBatchlet"/> 
</step> 
</job>
Start 
the 
Job 
JobOperator 
jobOperator 
= 
BatchRunYme.getJobOperator(); 
Long 
execuYonId 
= 
jobOperator.start("myJob", 
new 
ProperYes()); 
JobExecuYon 
jobExecuYon 
= 
jobOperator.getJobExecuYon(execuYonId);
Batchlet 
• Task 
oriented 
Batch 
Step 
• Suitable 
for 
• Short 
execuHons 
• Handle 
system 
resources 
• IniHalizaHon 
and 
Cleanup
Chunk 
• ETL 
style 
(Reader, 
Processor, 
Writer) 
• Suitable 
for 
• Handle 
large 
amounts 
of 
data 
• Failover 
safety 
(checkpoint) 
• Long 
running 
applicaHons
Chunk 
Processing 
Step 
ItemReader 
ItemProcessor 
ItemWriter 
read() 
read() 
process(item) 
process(item) 
write(items) 
item 
item 
item 
item 
execute() 
ExitStatus
Defining 
Chunk 
Step 
<step 
id="myChunk"> 
<chunk 
checkpoint-­‐policy="item" 
item-­‐count="3"> 
<reader 
ref=“myItemReader"/> 
<processor 
ref=“myItemProcessor"/> 
<writer 
ref=“myItemWriter"/> 
</chunk> 
</step>
Item 
Reader 
@Named 
public 
class 
MyItemReader 
extends 
AbstractItemReader 
{ 
public 
Object 
readItem() 
throws 
ExcepYon 
{…} 
}
Item 
Processor 
@Named 
public 
class 
MyItemProcessor 
implements 
ItemProcessor 
{ 
public 
Object 
processItem(Object 
item) 
throws 
ExcepYon 
{…} 
}
Item 
Writer 
@Named 
public 
class 
MyItemWriter 
extends 
AbstractItemWriter 
{ 
public 
void 
writeItems(List<Object> 
items) 
throws 
ExcepYon 
{…} 
}
ExcepYon 
Handling 
• Job 
ExecuHon 
Fails 
on 
ExcepHon 
• Possible 
to 
Skip 
or 
Retry 
ExcepHons 
• Applied 
to 
the 
Chunk 
• Include 
or 
Exclude 
ExcepHons
ExcepYon 
Handling 
DefiniYon 
<chunk 
checkpoint-­‐policy="item” 
item-­‐count="3" 
skip-­‐limit="3" 
retry-­‐limit="3"> 
<reader 
ref="myItemReader"/> 
<processor 
ref="myItemProcessor"/> 
<writer 
ref="myItemWriter"/> 
<skippable-­‐excepYon-­‐classes> 
<include 
class="java.lang.RunYmeExcepYon"/> 
</skippable-­‐excepYon-­‐classes> 
<retryable-­‐excepYon-­‐classes> 
<exclude 
class="java.lang.IllegalArgumentExcepYon"/> 
</retryable-­‐excepYon-­‐classes> 
</chunk>
ParYYon 
• Steps 
run 
on 
mulHple 
Threads 
• One 
ParHHon 
per 
Thread 
• Define 
ParHHon 
Plan 
• CheckpoinHng 
is 
independent 
per 
Thread
ParYYon 
DefiniYon 
(In 
Step) 
<parYYon> 
<plan 
parYYons="2"> 
<properYes 
parYYon="0"> 
<property 
name="start" 
value="1"/> 
</properYes> 
<properYes 
parYYon="1"> 
<property 
name="start" 
value="11"/> 
</properYes> 
</plan> 
</parYYon>
ParYYon 
DefiniYon 
(In 
Step) 
<chunk 
item-­‐count="3"> 
<reader 
ref="myItemReader"> 
<properYes> 
<property 
name="start” 
value="#{parYYonPlan['start']}" 
/> 
</properYes> 
</reader> 
<processor 
ref="myItemProcessor"/> 
<writer 
ref="myItemWriter"/> 
</chunk>
Flow 
• Sequence 
of 
ExecuHon 
elements 
• Execute 
together 
as 
a 
unit 
• Flows, 
Steps, 
Decision 
and 
Split 
• Used 
to 
aggregate 
logical 
business.
Split 
• Concurrent 
ExecuHon 
of 
Flows 
• Each 
Flow 
run 
on 
a 
separate 
Thread 
• Is 
not 
the 
same 
as 
a 
ParHHon 
• Can 
only 
use 
Flows
Split 
and 
Flow 
DefiniYon 
<split 
id="mySplit"> 
<flow 
id="flow1"> 
<step 
id="myChunk" 
next="myBatchlet”>…</step> 
<step 
id="myBatchlet">...</step> 
</flow> 
<flow 
id="flow2"> 
<step 
id=”otherChunk" 
next=”otherBatchlet”>…</step> 
<step 
id=”otherBatchlet">...</step> 
</flow> 
</split>
ParYYon 
vs 
Split 
• ParHHon 
is 
used 
at 
the 
data 
level 
• Split 
is 
used 
at 
the 
business 
level
Decision 
• Decide 
the 
next 
TransiHon 
• Applied 
to 
Steps, 
Flows 
and 
Splits 
• It’s 
almost 
like 
an 
if 
/ 
else 
if 
• Requires 
an 
implementaHon
Decision 
DefiniYon 
<step 
id=”myStep" 
next="myDecider"> 
<batchlet 
ref="myBatchlet”/> 
</step> 
<decision 
id="myDecider" 
ref="MyDecider"> 
<next 
on="foo" 
to="myFooStep"/> 
<next 
on="bar" 
to="myBarStep"/> 
</decision>
Decision 
@Named 
public 
class 
MyDecider 
implements 
Decider 
{ 
public 
String 
decide(StepExecuYon[] 
execuYons) 
throws 
ExcepYon 
{…} 
}
TransiYons 
• TransiHon 
Elements 
define 
the 
Workflow 
• Applied 
to 
Steps, 
Flows 
and 
Decision 
• Next, 
Fail, 
End, 
Stop 
• Fail, 
End 
and 
Stop 
terminate 
a 
Job
Batch 
Exit 
Status 
• A 
Job 
and 
Steps 
has 
an 
Exit 
Status 
• Used 
to 
control 
the 
Workflow 
• STARTING, 
STARTED, 
STOPPING, 
STOPPED, 
FAILED, 
COMPLETED, 
ABANDONED
Schedule 
a 
Job 
(By 
@Schedule) 
@Singleton 
public 
class 
BatchJobRunner 
{ 
@Schedule(dayOfWeek 
= 
"Sun") 
public 
void 
scheduleJob() 
{ 
JobOperator 
jobOperator 
= 
BatchRunYme.getJobOperator(); 
jobOperator.start("myJob", 
new 
ProperYes()); 
} 
}
Schedule 
a 
Job 
(By 
ManagedScheduledExecutorService) 
@Resource(lookup="java:comp/DefaultManagedScheduledExecutorService") 
private 
ManagedScheduledExecutorService 
executor; 
public 
void 
scheduleJob() 
{ 
JobOperator 
jobOperator 
= 
BatchRunYme.getJobOperator(); 
executor.schedule( 
() 
-­‐> 
jobOperator.start("myJob", 
new 
ProperYes()), 
7, 
TimeUnit.DAYS); 
}
ImplementaYons 
• JBatch 
IBM 
(Glassfish, 
JEUS) 
• JBeret 
(Wildfly) 
• Spring 
Batch
A 
Few 
Cons 
• Lacks 
standard 
Readers 
/ 
Writers 
• No 
Generics 
• ParHHon 
only 
supports 
a 
single 
Step 
• No 
Sync 
mode
Demo 
Time
WoW 
AucYon 
House 
• World 
of 
WacraT 
is 
MMORPG 
• More 
than 
500 
servers 
in 
US 
and 
EU 
• Each 
server 
has 
2 
AucHon 
Houses 
• Trades 
around 
70k 
items 
/ 
server 
/ 
hour
WoW 
AucYon 
House 
• Data 
available 
to 
download 
• Let’s 
process 
the 
data 
• Extract 
metrics 
• Share 
the 
knowledge
Live 
Code
Resources 
• JSR-­‐352 
SpecificaHon 
hips://jcp.org/en/jsr/detail?id=352 
• Java 
EE 
Samples 
hips://github.com/javaee-­‐samples 
• Wow 
AucHon 
House 
hips://github.com/radcortez/wow-­‐aucHons
Thank 
you 
for 
A/ending! 
Roberto 
Cortez 
@radcortez 
h/p://www.radcortez.com 
Ivan 
St. 
Ivanov 
@ivan_stefanov 
h/p://nosoGskills.com
Ad

More Related Content

What's hot (20)

facebook architecture for 600M users
facebook architecture for 600M usersfacebook architecture for 600M users
facebook architecture for 600M users
Jongyoon Choi
 
PHP - Introduction to PHP Cookies and Sessions
PHP - Introduction to PHP Cookies and SessionsPHP - Introduction to PHP Cookies and Sessions
PHP - Introduction to PHP Cookies and Sessions
Vibrant Technologies & Computers
 
HBase HUG Presentation: Avoiding Full GCs with MemStore-Local Allocation Buffers
HBase HUG Presentation: Avoiding Full GCs with MemStore-Local Allocation BuffersHBase HUG Presentation: Avoiding Full GCs with MemStore-Local Allocation Buffers
HBase HUG Presentation: Avoiding Full GCs with MemStore-Local Allocation Buffers
Cloudera, Inc.
 
webservice scaling for newbie
webservice scaling for newbiewebservice scaling for newbie
webservice scaling for newbie
DaeMyung Kang
 
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the CloudAmazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Noritaka Sekiyama
 
Single page applications
Single page applicationsSingle page applications
Single page applications
Diego Cardozo
 
ES6 presentation
ES6 presentationES6 presentation
ES6 presentation
ritika1
 
BPMN과 JIRA를 활용한 프로세스 중심 업무 혁신 실천법
BPMN과 JIRA를 활용한 프로세스 중심 업무 혁신 실천법BPMN과 JIRA를 활용한 프로세스 중심 업무 혁신 실천법
BPMN과 JIRA를 활용한 프로세스 중심 업무 혁신 실천법
철민 신
 
Installing Postgres on Linux
Installing Postgres on LinuxInstalling Postgres on Linux
Installing Postgres on Linux
EDB
 
jQuery Ajax
jQuery AjaxjQuery Ajax
jQuery Ajax
Anand Kumar Rajana
 
200.마이크로서비스에 적합한 오픈소스 WAS는 무엇?
200.마이크로서비스에 적합한 오픈소스 WAS는 무엇?200.마이크로서비스에 적합한 오픈소스 WAS는 무엇?
200.마이크로서비스에 적합한 오픈소스 WAS는 무엇?
Opennaru, inc.
 
MariaDB Xpand 고객사례 안내.pdf
MariaDB Xpand 고객사례 안내.pdfMariaDB Xpand 고객사례 안내.pdf
MariaDB Xpand 고객사례 안내.pdf
ssusercbaa33
 
Presentation on Crystal Reports and Business Objects Enterprise Features
Presentation on Crystal Reports and Business Objects Enterprise FeaturesPresentation on Crystal Reports and Business Objects Enterprise Features
Presentation on Crystal Reports and Business Objects Enterprise Features
InfoDev
 
Presto Summit 2018 - 09 - Netflix Iceberg
Presto Summit 2018  - 09 - Netflix IcebergPresto Summit 2018  - 09 - Netflix Iceberg
Presto Summit 2018 - 09 - Netflix Iceberg
kbajda
 
대용량 분산 아키텍쳐 설계 #5. rest
대용량 분산 아키텍쳐 설계 #5. rest대용량 분산 아키텍쳐 설계 #5. rest
대용량 분산 아키텍쳐 설계 #5. rest
Terry Cho
 
Webscripts
WebscriptsWebscripts
Webscripts
Alfresco Software
 
The InnoDB Storage Engine for MySQL
The InnoDB Storage Engine for MySQLThe InnoDB Storage Engine for MySQL
The InnoDB Storage Engine for MySQL
Morgan Tocker
 
Presentation1.pptx
Presentation1.pptxPresentation1.pptx
Presentation1.pptx
PradeepDyavannanavar
 
[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기
NAVER D2
 
HBase Storage Internals
HBase Storage InternalsHBase Storage Internals
HBase Storage Internals
DataWorks Summit
 
facebook architecture for 600M users
facebook architecture for 600M usersfacebook architecture for 600M users
facebook architecture for 600M users
Jongyoon Choi
 
HBase HUG Presentation: Avoiding Full GCs with MemStore-Local Allocation Buffers
HBase HUG Presentation: Avoiding Full GCs with MemStore-Local Allocation BuffersHBase HUG Presentation: Avoiding Full GCs with MemStore-Local Allocation Buffers
HBase HUG Presentation: Avoiding Full GCs with MemStore-Local Allocation Buffers
Cloudera, Inc.
 
webservice scaling for newbie
webservice scaling for newbiewebservice scaling for newbie
webservice scaling for newbie
DaeMyung Kang
 
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the CloudAmazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Amazon S3 Best Practice and Tuning for Hadoop/Spark in the Cloud
Noritaka Sekiyama
 
Single page applications
Single page applicationsSingle page applications
Single page applications
Diego Cardozo
 
ES6 presentation
ES6 presentationES6 presentation
ES6 presentation
ritika1
 
BPMN과 JIRA를 활용한 프로세스 중심 업무 혁신 실천법
BPMN과 JIRA를 활용한 프로세스 중심 업무 혁신 실천법BPMN과 JIRA를 활용한 프로세스 중심 업무 혁신 실천법
BPMN과 JIRA를 활용한 프로세스 중심 업무 혁신 실천법
철민 신
 
Installing Postgres on Linux
Installing Postgres on LinuxInstalling Postgres on Linux
Installing Postgres on Linux
EDB
 
200.마이크로서비스에 적합한 오픈소스 WAS는 무엇?
200.마이크로서비스에 적합한 오픈소스 WAS는 무엇?200.마이크로서비스에 적합한 오픈소스 WAS는 무엇?
200.마이크로서비스에 적합한 오픈소스 WAS는 무엇?
Opennaru, inc.
 
MariaDB Xpand 고객사례 안내.pdf
MariaDB Xpand 고객사례 안내.pdfMariaDB Xpand 고객사례 안내.pdf
MariaDB Xpand 고객사례 안내.pdf
ssusercbaa33
 
Presentation on Crystal Reports and Business Objects Enterprise Features
Presentation on Crystal Reports and Business Objects Enterprise FeaturesPresentation on Crystal Reports and Business Objects Enterprise Features
Presentation on Crystal Reports and Business Objects Enterprise Features
InfoDev
 
Presto Summit 2018 - 09 - Netflix Iceberg
Presto Summit 2018  - 09 - Netflix IcebergPresto Summit 2018  - 09 - Netflix Iceberg
Presto Summit 2018 - 09 - Netflix Iceberg
kbajda
 
대용량 분산 아키텍쳐 설계 #5. rest
대용량 분산 아키텍쳐 설계 #5. rest대용량 분산 아키텍쳐 설계 #5. rest
대용량 분산 아키텍쳐 설계 #5. rest
Terry Cho
 
The InnoDB Storage Engine for MySQL
The InnoDB Storage Engine for MySQLThe InnoDB Storage Engine for MySQL
The InnoDB Storage Engine for MySQL
Morgan Tocker
 
[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기
NAVER D2
 

Similar to Java EE 7 Batch processing in the Real World (20)

Spring batch
Spring batchSpring batch
Spring batch
Chandan Kumar Rana
 
Spring Batch
Spring BatchSpring Batch
Spring Batch
Jayasree Perilakkalam
 
Batching and Java EE (jdk.io)
Batching and Java EE (jdk.io)Batching and Java EE (jdk.io)
Batching and Java EE (jdk.io)
Ryan Cuprak
 
50 New Features of Java EE 7 in 50 minutes @ Devoxx France 2014
50 New Features of Java EE 7 in 50 minutes @ Devoxx France 201450 New Features of Java EE 7 in 50 minutes @ Devoxx France 2014
50 New Features of Java EE 7 in 50 minutes @ Devoxx France 2014
Arun Gupta
 
5050 dev nation
5050 dev nation5050 dev nation
5050 dev nation
Arun Gupta
 
50 features of Java EE 7 in 50 minutes at Geecon 2014
50 features of Java EE 7 in 50 minutes at Geecon 201450 features of Java EE 7 in 50 minutes at Geecon 2014
50 features of Java EE 7 in 50 minutes at Geecon 2014
Arun Gupta
 
Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from Oredev
Mattias Karlsson
 
Spring Batch Workshop
Spring Batch WorkshopSpring Batch Workshop
Spring Batch Workshop
lyonjug
 
Javazone 2019 - Mutants to the rescue: How effective are your unit tests?
Javazone 2019 - Mutants to the rescue: How effective are your unit tests?Javazone 2019 - Mutants to the rescue: How effective are your unit tests?
Javazone 2019 - Mutants to the rescue: How effective are your unit tests?
Paco van Beckhoven
 
50 New Features of Java EE 7 in 50 minutes
50 New Features of Java EE 7 in 50 minutes50 New Features of Java EE 7 in 50 minutes
50 New Features of Java EE 7 in 50 minutes
Arun Gupta
 
Effiziente persistierung
Effiziente persistierungEffiziente persistierung
Effiziente persistierung
Thorben Janssen
 
Java Batch
Java BatchJava Batch
Java Batch
Software Infrastructure
 
vJUG - The JavaFX Ecosystem
vJUG - The JavaFX EcosystemvJUG - The JavaFX Ecosystem
vJUG - The JavaFX Ecosystem
Andres Almiray
 
Spring data requery
Spring data requerySpring data requery
Spring data requery
Sunghyouk Bae
 
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
Arun Gupta
 
Spring Batch 2.0
Spring Batch 2.0Spring Batch 2.0
Spring Batch 2.0
Guido Schmutz
 
JS Essence
JS EssenceJS Essence
JS Essence
Uladzimir Piatryka
 
Code transformation With Spoon
Code transformation With SpoonCode transformation With Spoon
Code transformation With Spoon
Gérard Paligot
 
Javatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparisonJavatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparison
Jini Lee
 
Effiziente Datenpersistierung mit JPA 2.1 und Hibernate
Effiziente Datenpersistierung mit JPA 2.1 und HibernateEffiziente Datenpersistierung mit JPA 2.1 und Hibernate
Effiziente Datenpersistierung mit JPA 2.1 und Hibernate
Thorben Janssen
 
Batching and Java EE (jdk.io)
Batching and Java EE (jdk.io)Batching and Java EE (jdk.io)
Batching and Java EE (jdk.io)
Ryan Cuprak
 
50 New Features of Java EE 7 in 50 minutes @ Devoxx France 2014
50 New Features of Java EE 7 in 50 minutes @ Devoxx France 201450 New Features of Java EE 7 in 50 minutes @ Devoxx France 2014
50 New Features of Java EE 7 in 50 minutes @ Devoxx France 2014
Arun Gupta
 
5050 dev nation
5050 dev nation5050 dev nation
5050 dev nation
Arun Gupta
 
50 features of Java EE 7 in 50 minutes at Geecon 2014
50 features of Java EE 7 in 50 minutes at Geecon 201450 features of Java EE 7 in 50 minutes at Geecon 2014
50 features of Java EE 7 in 50 minutes at Geecon 2014
Arun Gupta
 
Java 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from OredevJava 7 Whats New(), Whats Next() from Oredev
Java 7 Whats New(), Whats Next() from Oredev
Mattias Karlsson
 
Spring Batch Workshop
Spring Batch WorkshopSpring Batch Workshop
Spring Batch Workshop
lyonjug
 
Javazone 2019 - Mutants to the rescue: How effective are your unit tests?
Javazone 2019 - Mutants to the rescue: How effective are your unit tests?Javazone 2019 - Mutants to the rescue: How effective are your unit tests?
Javazone 2019 - Mutants to the rescue: How effective are your unit tests?
Paco van Beckhoven
 
50 New Features of Java EE 7 in 50 minutes
50 New Features of Java EE 7 in 50 minutes50 New Features of Java EE 7 in 50 minutes
50 New Features of Java EE 7 in 50 minutes
Arun Gupta
 
Effiziente persistierung
Effiziente persistierungEffiziente persistierung
Effiziente persistierung
Thorben Janssen
 
vJUG - The JavaFX Ecosystem
vJUG - The JavaFX EcosystemvJUG - The JavaFX Ecosystem
vJUG - The JavaFX Ecosystem
Andres Almiray
 
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
Java EE 7: Whats New in the Java EE Platform @ Devoxx 2013
Arun Gupta
 
Code transformation With Spoon
Code transformation With SpoonCode transformation With Spoon
Code transformation With Spoon
Gérard Paligot
 
Javatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparisonJavatwo2012 java frameworkcomparison
Javatwo2012 java frameworkcomparison
Jini Lee
 
Effiziente Datenpersistierung mit JPA 2.1 und Hibernate
Effiziente Datenpersistierung mit JPA 2.1 und HibernateEffiziente Datenpersistierung mit JPA 2.1 und Hibernate
Effiziente Datenpersistierung mit JPA 2.1 und Hibernate
Thorben Janssen
 
Ad

More from Roberto Cortez (15)

Chasing the RESTful Trinity - Client CLI and Documentation
Chasing the RESTful Trinity - Client CLI and DocumentationChasing the RESTful Trinity - Client CLI and Documentation
Chasing the RESTful Trinity - Client CLI and Documentation
Roberto Cortez
 
Baking a Microservice PI(e)
Baking a Microservice PI(e)Baking a Microservice PI(e)
Baking a Microservice PI(e)
Roberto Cortez
 
GraalVM and MicroProfile - A Polyglot Microservices Solution
GraalVM and MicroProfile - A Polyglot Microservices SolutionGraalVM and MicroProfile - A Polyglot Microservices Solution
GraalVM and MicroProfile - A Polyglot Microservices Solution
Roberto Cortez
 
Deconstructing and Evolving REST Security
Deconstructing and Evolving REST SecurityDeconstructing and Evolving REST Security
Deconstructing and Evolving REST Security
Roberto Cortez
 
Lightweight Enterprise Java With Microprofile
Lightweight Enterprise Java With MicroprofileLightweight Enterprise Java With Microprofile
Lightweight Enterprise Java With Microprofile
Roberto Cortez
 
Cluster your MicroProfile Application using CDI and JCache
Cluster your MicroProfile Application using CDI and JCacheCluster your MicroProfile Application using CDI and JCache
Cluster your MicroProfile Application using CDI and JCache
Roberto Cortez
 
Java EE 7 meets Java 8
Java EE 7 meets Java 8Java EE 7 meets Java 8
Java EE 7 meets Java 8
Roberto Cortez
 
Maven - Taming the Beast
Maven - Taming the BeastMaven - Taming the Beast
Maven - Taming the Beast
Roberto Cortez
 
The First Contact with Java EE 7
The First Contact with Java EE 7The First Contact with Java EE 7
The First Contact with Java EE 7
Roberto Cortez
 
Migration tales from java ee 5 to 7
Migration tales from java ee 5 to 7Migration tales from java ee 5 to 7
Migration tales from java ee 5 to 7
Roberto Cortez
 
Development Horror Stories
Development Horror StoriesDevelopment Horror Stories
Development Horror Stories
Roberto Cortez
 
The 5 People in your Organization that grow Legacy Code
The 5 People in your Organization that grow Legacy CodeThe 5 People in your Organization that grow Legacy Code
The 5 People in your Organization that grow Legacy Code
Roberto Cortez
 
Geecon 2014 - Five Ways to Not Suck at Being a Java Freelancer
Geecon 2014 - Five Ways to Not Suck at Being a Java FreelancerGeecon 2014 - Five Ways to Not Suck at Being a Java Freelancer
Geecon 2014 - Five Ways to Not Suck at Being a Java Freelancer
Roberto Cortez
 
Coimbra JUG - 2º Encontro - O primeiro contacto com Java EE 7
Coimbra JUG - 2º Encontro - O primeiro contacto com Java EE 7Coimbra JUG - 2º Encontro - O primeiro contacto com Java EE 7
Coimbra JUG - 2º Encontro - O primeiro contacto com Java EE 7
Roberto Cortez
 
Coimbra JUG - 1º Encontro - As novidades do Java 8
Coimbra JUG - 1º Encontro - As novidades do Java 8Coimbra JUG - 1º Encontro - As novidades do Java 8
Coimbra JUG - 1º Encontro - As novidades do Java 8
Roberto Cortez
 
Chasing the RESTful Trinity - Client CLI and Documentation
Chasing the RESTful Trinity - Client CLI and DocumentationChasing the RESTful Trinity - Client CLI and Documentation
Chasing the RESTful Trinity - Client CLI and Documentation
Roberto Cortez
 
Baking a Microservice PI(e)
Baking a Microservice PI(e)Baking a Microservice PI(e)
Baking a Microservice PI(e)
Roberto Cortez
 
GraalVM and MicroProfile - A Polyglot Microservices Solution
GraalVM and MicroProfile - A Polyglot Microservices SolutionGraalVM and MicroProfile - A Polyglot Microservices Solution
GraalVM and MicroProfile - A Polyglot Microservices Solution
Roberto Cortez
 
Deconstructing and Evolving REST Security
Deconstructing and Evolving REST SecurityDeconstructing and Evolving REST Security
Deconstructing and Evolving REST Security
Roberto Cortez
 
Lightweight Enterprise Java With Microprofile
Lightweight Enterprise Java With MicroprofileLightweight Enterprise Java With Microprofile
Lightweight Enterprise Java With Microprofile
Roberto Cortez
 
Cluster your MicroProfile Application using CDI and JCache
Cluster your MicroProfile Application using CDI and JCacheCluster your MicroProfile Application using CDI and JCache
Cluster your MicroProfile Application using CDI and JCache
Roberto Cortez
 
Java EE 7 meets Java 8
Java EE 7 meets Java 8Java EE 7 meets Java 8
Java EE 7 meets Java 8
Roberto Cortez
 
Maven - Taming the Beast
Maven - Taming the BeastMaven - Taming the Beast
Maven - Taming the Beast
Roberto Cortez
 
The First Contact with Java EE 7
The First Contact with Java EE 7The First Contact with Java EE 7
The First Contact with Java EE 7
Roberto Cortez
 
Migration tales from java ee 5 to 7
Migration tales from java ee 5 to 7Migration tales from java ee 5 to 7
Migration tales from java ee 5 to 7
Roberto Cortez
 
Development Horror Stories
Development Horror StoriesDevelopment Horror Stories
Development Horror Stories
Roberto Cortez
 
The 5 People in your Organization that grow Legacy Code
The 5 People in your Organization that grow Legacy CodeThe 5 People in your Organization that grow Legacy Code
The 5 People in your Organization that grow Legacy Code
Roberto Cortez
 
Geecon 2014 - Five Ways to Not Suck at Being a Java Freelancer
Geecon 2014 - Five Ways to Not Suck at Being a Java FreelancerGeecon 2014 - Five Ways to Not Suck at Being a Java Freelancer
Geecon 2014 - Five Ways to Not Suck at Being a Java Freelancer
Roberto Cortez
 
Coimbra JUG - 2º Encontro - O primeiro contacto com Java EE 7
Coimbra JUG - 2º Encontro - O primeiro contacto com Java EE 7Coimbra JUG - 2º Encontro - O primeiro contacto com Java EE 7
Coimbra JUG - 2º Encontro - O primeiro contacto com Java EE 7
Roberto Cortez
 
Coimbra JUG - 1º Encontro - As novidades do Java 8
Coimbra JUG - 1º Encontro - As novidades do Java 8Coimbra JUG - 1º Encontro - As novidades do Java 8
Coimbra JUG - 1º Encontro - As novidades do Java 8
Roberto Cortez
 
Ad

Recently uploaded (20)

2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Rock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning JourneyRock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning Journey
Lynda Kane
 
Asthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdfAsthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdf
VanessaRaudez
 
Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.
gregtap1
 
Automation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From AnywhereAutomation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From Anywhere
Lynda Kane
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Datastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptxDatastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptx
kaleeswaric3
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko
Fwdays
 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
Buckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug LogsBuckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug Logs
Lynda Kane
 
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5..."Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
Fwdays
 
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical DebtBuckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Lynda Kane
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Rock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning JourneyRock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning Journey
Lynda Kane
 
Asthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdfAsthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdf
VanessaRaudez
 
Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.Network Security. Different aspects of Network Security.
Network Security. Different aspects of Network Security.
gregtap1
 
Automation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From AnywhereAutomation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From Anywhere
Lynda Kane
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
Datastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptxDatastucture-Unit 4-Linked List Presentation.pptx
Datastucture-Unit 4-Linked List Presentation.pptx
kaleeswaric3
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko"Rebranding for Growth", Anna Velykoivanenko
"Rebranding for Growth", Anna Velykoivanenko
Fwdays
 
Hands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordDataHands On: Create a Lightning Aura Component with force:RecordData
Hands On: Create a Lightning Aura Component with force:RecordData
Lynda Kane
 
Buckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug LogsBuckeye Dreamin' 2023: De-fogging Debug Logs
Buckeye Dreamin' 2023: De-fogging Debug Logs
Lynda Kane
 
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5..."Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
"Client Partnership — the Path to Exponential Growth for Companies Sized 50-5...
Fwdays
 
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical DebtBuckeye Dreamin 2024: Assessing and Resolving Technical Debt
Buckeye Dreamin 2024: Assessing and Resolving Technical Debt
Lynda Kane
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 

Java EE 7 Batch processing in the Real World

  • 1. Java EE 7 Batch Processing in the Real World Roberto Cortez & Ivan St. Ivanov JavaOne 2014 #CON2818
  • 2. Who are we? Roberto Cortez @radcortez h/p://www.radcortez.com Freelancer, Speaker, RebelLabs Author, Blogger Ivan St. Ivanov @ivan_stefanov h/p://nosoGskills.com Architect, SAP Labs Bulgaria, JBoss Forge contributor
  • 3. QuesHons? As soon as you have them!
  • 4. What is Batch? “A group of records processed as a single unit, usually without input from a user.” (from Google)
  • 5. Why Batch? (Computers) • Make use of idle resources • ShiT the Hme of processing • Manage large repeated work easily • Shared by mulHple users
  • 6. Batch is in our lives • By paying bills • On the grocery • In traffic • Cooking food
  • 7. Why Batch? (General) • Efficiency • Focus on a single problem • Avoid context switch • Reduce costs
  • 8. State of the Art • Spring Batch • IBM Websphere • Hadoop • Java SE, Scheduler, in-­‐house frameworks
  • 9. The JSR-­‐352 • Batch ApplicaHons for the Java pla]orm • Heavily inspired by Spring Batch • Available since Java EE 7 • Also designed for Java SE
  • 10. The JSR-­‐352 Features • Task and Chunk oriented processing • SequenHal and/or Parallel execuHon • CheckpoinHng • Workflow • Stop and restart • ExcepHon handling
  • 11. Batch Domain Language Job Operator Job Step Job Repository Item Reader Item Processor Item Writer 1 *
  • 12. Job composiYon * Job Step * JobInstance * * * JobExecuYon StepExecuYon
  • 14. Batchlet DefiniYon @Named public class MyBatchlet extends AbstractBatchlet { @Override public String process() { System.out.println("Running inside a batchlet"); return BatchStatus.COMPLETED.toString(); } }
  • 15. Job SpecificaYon Language <job id="myFirstBatch"> <step id="myStep" > <batchlet ref="myBatchlet"/> </step> </job>
  • 16. Start the Job JobOperator jobOperator = BatchRunYme.getJobOperator(); Long execuYonId = jobOperator.start("myJob", new ProperYes()); JobExecuYon jobExecuYon = jobOperator.getJobExecuYon(execuYonId);
  • 17. Batchlet • Task oriented Batch Step • Suitable for • Short execuHons • Handle system resources • IniHalizaHon and Cleanup
  • 18. Chunk • ETL style (Reader, Processor, Writer) • Suitable for • Handle large amounts of data • Failover safety (checkpoint) • Long running applicaHons
  • 19. Chunk Processing Step ItemReader ItemProcessor ItemWriter read() read() process(item) process(item) write(items) item item item item execute() ExitStatus
  • 20. Defining Chunk Step <step id="myChunk"> <chunk checkpoint-­‐policy="item" item-­‐count="3"> <reader ref=“myItemReader"/> <processor ref=“myItemProcessor"/> <writer ref=“myItemWriter"/> </chunk> </step>
  • 21. Item Reader @Named public class MyItemReader extends AbstractItemReader { public Object readItem() throws ExcepYon {…} }
  • 22. Item Processor @Named public class MyItemProcessor implements ItemProcessor { public Object processItem(Object item) throws ExcepYon {…} }
  • 23. Item Writer @Named public class MyItemWriter extends AbstractItemWriter { public void writeItems(List<Object> items) throws ExcepYon {…} }
  • 24. ExcepYon Handling • Job ExecuHon Fails on ExcepHon • Possible to Skip or Retry ExcepHons • Applied to the Chunk • Include or Exclude ExcepHons
  • 25. ExcepYon Handling DefiniYon <chunk checkpoint-­‐policy="item” item-­‐count="3" skip-­‐limit="3" retry-­‐limit="3"> <reader ref="myItemReader"/> <processor ref="myItemProcessor"/> <writer ref="myItemWriter"/> <skippable-­‐excepYon-­‐classes> <include class="java.lang.RunYmeExcepYon"/> </skippable-­‐excepYon-­‐classes> <retryable-­‐excepYon-­‐classes> <exclude class="java.lang.IllegalArgumentExcepYon"/> </retryable-­‐excepYon-­‐classes> </chunk>
  • 26. ParYYon • Steps run on mulHple Threads • One ParHHon per Thread • Define ParHHon Plan • CheckpoinHng is independent per Thread
  • 27. ParYYon DefiniYon (In Step) <parYYon> <plan parYYons="2"> <properYes parYYon="0"> <property name="start" value="1"/> </properYes> <properYes parYYon="1"> <property name="start" value="11"/> </properYes> </plan> </parYYon>
  • 28. ParYYon DefiniYon (In Step) <chunk item-­‐count="3"> <reader ref="myItemReader"> <properYes> <property name="start” value="#{parYYonPlan['start']}" /> </properYes> </reader> <processor ref="myItemProcessor"/> <writer ref="myItemWriter"/> </chunk>
  • 29. Flow • Sequence of ExecuHon elements • Execute together as a unit • Flows, Steps, Decision and Split • Used to aggregate logical business.
  • 30. Split • Concurrent ExecuHon of Flows • Each Flow run on a separate Thread • Is not the same as a ParHHon • Can only use Flows
  • 31. Split and Flow DefiniYon <split id="mySplit"> <flow id="flow1"> <step id="myChunk" next="myBatchlet”>…</step> <step id="myBatchlet">...</step> </flow> <flow id="flow2"> <step id=”otherChunk" next=”otherBatchlet”>…</step> <step id=”otherBatchlet">...</step> </flow> </split>
  • 32. ParYYon vs Split • ParHHon is used at the data level • Split is used at the business level
  • 33. Decision • Decide the next TransiHon • Applied to Steps, Flows and Splits • It’s almost like an if / else if • Requires an implementaHon
  • 34. Decision DefiniYon <step id=”myStep" next="myDecider"> <batchlet ref="myBatchlet”/> </step> <decision id="myDecider" ref="MyDecider"> <next on="foo" to="myFooStep"/> <next on="bar" to="myBarStep"/> </decision>
  • 35. Decision @Named public class MyDecider implements Decider { public String decide(StepExecuYon[] execuYons) throws ExcepYon {…} }
  • 36. TransiYons • TransiHon Elements define the Workflow • Applied to Steps, Flows and Decision • Next, Fail, End, Stop • Fail, End and Stop terminate a Job
  • 37. Batch Exit Status • A Job and Steps has an Exit Status • Used to control the Workflow • STARTING, STARTED, STOPPING, STOPPED, FAILED, COMPLETED, ABANDONED
  • 38. Schedule a Job (By @Schedule) @Singleton public class BatchJobRunner { @Schedule(dayOfWeek = "Sun") public void scheduleJob() { JobOperator jobOperator = BatchRunYme.getJobOperator(); jobOperator.start("myJob", new ProperYes()); } }
  • 39. Schedule a Job (By ManagedScheduledExecutorService) @Resource(lookup="java:comp/DefaultManagedScheduledExecutorService") private ManagedScheduledExecutorService executor; public void scheduleJob() { JobOperator jobOperator = BatchRunYme.getJobOperator(); executor.schedule( () -­‐> jobOperator.start("myJob", new ProperYes()), 7, TimeUnit.DAYS); }
  • 40. ImplementaYons • JBatch IBM (Glassfish, JEUS) • JBeret (Wildfly) • Spring Batch
  • 41. A Few Cons • Lacks standard Readers / Writers • No Generics • ParHHon only supports a single Step • No Sync mode
  • 43. WoW AucYon House • World of WacraT is MMORPG • More than 500 servers in US and EU • Each server has 2 AucHon Houses • Trades around 70k items / server / hour
  • 44. WoW AucYon House • Data available to download • Let’s process the data • Extract metrics • Share the knowledge
  • 46. Resources • JSR-­‐352 SpecificaHon hips://jcp.org/en/jsr/detail?id=352 • Java EE Samples hips://github.com/javaee-­‐samples • Wow AucHon House hips://github.com/radcortez/wow-­‐aucHons
  • 47. Thank you for A/ending! Roberto Cortez @radcortez h/p://www.radcortez.com Ivan St. Ivanov @ivan_stefanov h/p://nosoGskills.com