$30 off During Our Annual Pro Sale. View Details »
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
0
72
Introduction to JCA and MDB
HASUNUMA Kenji
September 30, 2017
Tweet
Share
More Decks by HASUNUMA Kenji
See All by HASUNUMA Kenji
Jakarta EE: The First Parts
khasunuma
0
46
Life of our small product
khasunuma
0
34
How to adapt MicroProfile API for generic Web applications
khasunuma
0
31
Overviewing Admin Console
khasunuma
0
30
Introduction to MicroProfile Metrics
khasunuma
0
52
Basic method for Java EE Web Profile
khasunuma
0
28
Collections Framework Begineers Guide 2
khasunuma
0
64
JLS myths ~ if-then-else statement ~
khasunuma
0
33
Introduction to Date and Time API 4
khasunuma
0
64
Other Decks in Programming
See All in Programming
UIデザインに役立つ 2025年の最新CSS / The Latest CSS for UI Design 2025
clockmaker
2
980
無秩序からの脱却 / Emergence from chaos
nrslib
2
10k
Duke on CRaC with Jakarta EE
ivargrimstad
0
310
20251127_ぼっちのための懇親会対策会議
kokamoto01_metaps
2
240
複数人でのCLI/Infrastructure as Codeの暮らしを良くする
shmokmt
4
1.5k
生成AIを活用したリファクタリング実践 ~コードスメルをなくすためのアプローチ
raedion
0
160
WebRTC と Rust と8K 60fps
tnoho
2
1k
社内オペレーション改善のためのTypeScript / TSKaigi Hokuriku 2025
dachi023
1
130
AWS CDKの推しポイントN選
akihisaikeda
1
210
なあ兄弟、 余白の意味を考えてから UI実装してくれ!
ktcryomm
10
9.3k
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
150
関数の挙動書き換える
takatofukui
4
750
Featured
See All Featured
Unsuck your backbone
ammeep
671
58k
Agile that works and the tools we love
rasmusluckow
331
21k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
10
690
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.1k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Thoughts on Productivity
jonyablonski
73
4.9k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
9
990
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
BBQ
matthewcrist
89
9.9k
Mobile First: as difficult as doing things right
swwweet
225
10k
We Have a Design System, Now What?
morganepeng
54
7.9k
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