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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
HASUNUMA Kenji
September 30, 2017
Programming
94
0
Share
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
58
Life of our small product
khasunuma
0
47
How to adapt MicroProfile API for generic Web applications
khasunuma
0
45
Overviewing Admin Console
khasunuma
0
43
Introduction to MicroProfile Metrics
khasunuma
0
67
Basic method for Java EE Web Profile
khasunuma
0
41
Collections Framework Begineers Guide 2
khasunuma
0
83
JLS myths ~ if-then-else statement ~
khasunuma
0
57
Introduction to Date and Time API 4
khasunuma
0
78
Other Decks in Programming
See All in Programming
Agentic UI in the Frontend: Architectures with Open Standards @JAX 2026 in Mainz
manfredsteyer
PRO
0
110
AI Agent と正しく分析するための環境作り
yoshyum
2
390
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
5
1.6k
ハーネスエンジニアリングとは?
kinopeee
13
6.9k
Road to RubyKaigi: Play Hard(ware)
makicamel
1
570
AI時代だからこそ「Bloc」を採用する価値があるのかもしれない
takuroabe
0
150
AIと共に生きる技術選定 2026
sgash708
0
140
過去のレビュー知見をSkillsで資産化した話
pkshadeck
PRO
1
1.8k
「OSSがあるなら自作するな」は AI時代も正しいか ── Build vs Adopt の新しい判断基準
kumorn5s
7
2.6k
エラー処理の温故知新 / history of error handling technic
ryotanakaya
7
1.9k
GitHubCopilotCLIをはじめよう.pdf
htkym
0
330
空間オーディオの活用
objectiveaudio
0
150
Featured
See All Featured
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
140
SEO for Brand Visibility & Recognition
aleyda
0
4.5k
How to build a perfect <img>
jonoalderson
1
5.5k
RailsConf 2023
tenderlove
30
1.4k
Designing for humans not robots
tammielis
254
26k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
140
How to train your dragon (web standard)
notwaldorf
97
6.6k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
Design in an AI World
tapps
1
210
The SEO identity crisis: Don't let AI make you average
varn
0
460
First, design no harm
axbom
PRO
2
1.2k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.4k
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