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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
HASUNUMA Kenji
September 30, 2017
Programming
95
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
44
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
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
640
Lightning-Fast Method Calls with Ruby 4.1 ZJIT / RubyKaigi 2026
k0kubun
3
2.9k
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
420
継続的な負荷検証を目指して
pyama86
3
1.1k
20年以上続くプロダクトでも使い続けられる静的解析ツールを求めて
matsuo_atsushi
0
150
リセットCSSを1行消したらアクセシビリティが向上した話
pvcresin
4
510
Agentic Elixir
whatyouhide
0
450
t *testing.T は どこからやってくるの?
otakakot
1
930
Kubernetesを使わない環境にもCloud Nativeなデプロイを実現する / Enabling Cloud Native deployments without the complexity of Kubernetes
linyows
3
390
「なんか〇〇ライブラリで脆弱性あるみたいなんだけど。。。」から始める脆弱性対応 / First Steps in Vulnerability Response
mackey0225
2
120
cloudnative conference 2026 flyle
azihsoyn
0
180
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
170
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
42
3k
Optimizing for Happiness
mojombo
378
71k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
170
The SEO identity crisis: Don't let AI make you average
varn
0
460
4 Signs Your Business is Dying
shpigford
187
22k
We Are The Robots
honzajavorek
0
230
Code Reviewing Like a Champion
maltzj
528
40k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.4k
The agentic SEO stack - context over prompts
schlessera
0
780
Git: the NoSQL Database
bkeepers
PRO
432
67k
Agile that works and the tools we love
rasmusluckow
331
21k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
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