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
Introduction to JCA and MDB
Search
HASUNUMA Kenji
September 30, 2017
Programming
110
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Introduction to JCA and MDB
HASUNUMA Kenji
September 30, 2017
More Decks by HASUNUMA Kenji
See All by HASUNUMA Kenji
Jakarta EE: The First Parts
khasunuma
0
72
Life of our small product
khasunuma
0
50
How to adapt MicroProfile API for generic Web applications
khasunuma
0
49
Overviewing Admin Console
khasunuma
0
48
Introduction to MicroProfile Metrics
khasunuma
0
78
Basic method for Java EE Web Profile
khasunuma
0
49
Collections Framework Begineers Guide 2
khasunuma
0
91
JLS myths ~ if-then-else statement ~
khasunuma
0
70
Introduction to Date and Time API 4
khasunuma
0
89
Other Decks in Programming
See All in Programming
go-spidermonkeyでAIエージェントのCode Modeを実装する
syumai
3
1.3k
Go 1.27からのGODEBUG / Go 1.27 リリースパーティ #go127party
mazrean
0
250
30年振りにコンパイラの定数整数除算を改善した
herumi
9
4.3k
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
110
使いながら育てる Claude Code — 開発フローの1コマンド化 × 繰り返し指摘の自動仕組み化
shiki_kakaku
1
2k
Flow は今どうなっているか
mizdra
PRO
0
750
typoなんかねぇよ
raspython3
0
610
Detecting Compromised CI with eBPF and Cilium Tetragon
lizrice
0
270
T3DD26: From RAGs to Riches
martinhelmich
0
110
承認済みなのに差戻しできてしまうバグ、型で潰せます
shinchit
0
120
リアルな遅延を測る仕様
kota_yata
1
130
My Marp Sample
sinoue0108
0
130
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
41
2.7k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
3
1.1k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
580
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.6k
GitHub's CSS Performance
jonrohan
1033
470k
Design in an AI World
tapps
1
290
Scaling GitHub
holman
464
140k
The Language of Interfaces
destraynor
162
27k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.2k
RailsConf 2023
tenderlove
30
1.5k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
Transcript
Introduction to JCA and MDB HASUNUMA Kenji GlassFish Users
Group Japan
[email protected]
Twitter: @khasunuma
What's JCA? • JCA (Java Connector Architecture) brings integration between
systems • JCA is also base of Java EE servers • Almost Java EE developer have been used JCA
JCA Overview External System (e.g. EIS) Java EE Resource
Adapter (.rar) Web app. (.war) Outbound Inbound Java Connector Architecture (JCA)
Contracts (1/2) since JCA 1.0 (J2EE 1.3) • Connection management
(Connection pooling) • Transaction management (w/JTA) • Security management (w/JAAS)
Contracts (2/2) since JCA 1.5 (J2EE 1.4) • Life cycle
management • Work management • Transaction inflow management • Message inflow management
Application Architecture ConnectionFactory EJB Connection External System getConnection JNDI lookup
Outbound Inbound I/F
Application c.f. JMS ConnectionFactory EJB Connection JMS broker getConnection JNDI
lookup Outbound Inbound JMS
Application c.f. JDBC DataSource EJB Connection RDBMS getConnection JNDI lookup
SQL JDBC
Programming w/JCA • Many cases, JCA resource adapter is provided
by each systems • Recently JCA is mainly used to manage message inflow • In JCA 1.7 (Java EE 7/8), properties are set by annotations
Outbound @ConnectionFactoryDefinition( name = "java:comp/env/OutboundConnectionFactory", interfacename = com.example.jca.OutboundConnectionFactory, resourceAdapter =
"some-rar", ... ) @Stateless public class ExampleMessageSender { @Resource(lookup = "java.comp/env/OutboundConnectionFactory") OutboundConnectionFactory factory; public void send(...) { try (OutboundConnection conn = factory.createConnection()) { ... } catch (Exception e) { ... } } }
Attention • Session Bean SHOULD NOT be used to listen
messages • SHOULD use Message Driven Bean (MDB) to listen messages
What's MDB? • EJB specified for listening messages • Have
a callback method and handle inbound messages provided by JCA • MDB adapts both async and sync communication
Inbound @MessageDriven( activationConfig = { @ActivationConfigProperty(propertyName = ..., propertyValue =
...), ... } ) public class ExampleMessageListener implements MessageListener { public void onMessage(Message message) { ... } } Callback method invoked by the Resource Adapter
Use case: Payara Micro • Payara Micro connects other systems
on cloud via JCA adapters; • Apache Kafka • MQTT (Mosquitto, etc.) • Amazon SQS • Microsoft Azure Service Bus
Why MQ? • System/service requirements are different each other •
Now various systems/services are integrated on cloud platforms • MQ (i.g. Async) often resolves impedance matching between each systems/services
JCA is ... • JCA (Java Connector Architecture) brings integration
between systems • JCA is also base of Java EE servers, e.g. JMS, JDBC • Almost Java EE developer have been used JCA as JDBC data source
Introduction to JCA and MDB HASUNUMA Kenji GlassFish Users Group
Japan
[email protected]
Twitter: @khasunuma