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
0
59
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
37
Life of our small product
khasunuma
0
19
How to adapt MicroProfile API for generic Web applications
khasunuma
0
25
Overviewing Admin Console
khasunuma
0
22
Introduction to MicroProfile Metrics
khasunuma
0
46
Basic method for Java EE Web Profile
khasunuma
0
22
Collections Framework Begineers Guide 2
khasunuma
0
59
JLS myths ~ if-then-else statement ~
khasunuma
0
23
Introduction to Date and Time API 4
khasunuma
0
55
Other Decks in Programming
See All in Programming
生成AI時代のフルスタック開発
kenn
8
1k
Boast Code Party / RubyKaigi 2025 After Event
lemonade_37
0
120
CRUD から CQRS へ ~ 分離が可能にする柔軟性
tkawae
0
170
SpringBootにおけるオブザーバビリティのなにか
irof
0
240
AI Coding Agents Enablement in TypeScript
yukukotani
8
1.6k
ComposeでのPicture in Picture
takathemax
0
150
Global Azure 2025 @ Kansai / Hyperlight
kosmosebi
0
160
ビカム・ア・コパイロット
ymd65536
1
170
マテリアルって何者?RealityKitで扱うマテリアル入門
nao_randd
0
120
Design Pressure
hynek
0
180
Digging into the Matrix: Practicing Code Archaeology
arthurdoler
PRO
0
120
クラシルリワードにおける iOSアプリ開発の取り組み
funzin
1
230
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.5k
Facilitating Awesome Meetings
lara
54
6.4k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
34
2.2k
How to Ace a Technical Interview
jacobian
276
23k
What's in a price? How to price your products and services
michaelherold
245
12k
Making the Leap to Tech Lead
cromwellryan
133
9.3k
YesSQL, Process and Tooling at Scale
rocio
172
14k
Adopting Sorbet at Scale
ufuk
76
9.4k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
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