$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
78
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
47
Life of our small product
khasunuma
0
35
How to adapt MicroProfile API for generic Web applications
khasunuma
0
33
Overviewing Admin Console
khasunuma
0
31
Introduction to MicroProfile Metrics
khasunuma
0
54
Basic method for Java EE Web Profile
khasunuma
0
30
Collections Framework Begineers Guide 2
khasunuma
0
66
JLS myths ~ if-then-else statement ~
khasunuma
0
35
Introduction to Date and Time API 4
khasunuma
0
65
Other Decks in Programming
See All in Programming
【CA.ai #3】ワークフローから見直すAIエージェント — 必要な場面と“選ばない”判断
satoaoaka
0
250
re:Invent 2025 のイケてるサービスを紹介する
maroon1st
0
120
非同期処理の迷宮を抜ける: 初学者がつまづく構造的な原因
pd1xx
1
720
JETLS.jl ─ A New Language Server for Julia
abap34
1
410
堅牢なフロントエンドテスト基盤を構築するために行った取り組み
shogo4131
8
2.4k
複数人でのCLI/Infrastructure as Codeの暮らしを良くする
shmokmt
5
2.3k
S3 VectorsとStrands Agentsを利用したAgentic RAGシステムの構築
tosuri13
6
320
TestingOsaka6_Ozono
o3
0
160
AIエージェントを活かすPM術 AI駆動開発の現場から
gyuta
0
430
俺流レスポンシブコーディング 2025
tak_dcxi
14
8.9k
FluorTracer / RayTracingCamp11
kugimasa
0
230
ELYZA_Findy AI Engineering Summit登壇資料_AIコーディング時代に「ちゃんと」やること_toB LLMプロダクト開発舞台裏_20251216
elyza
0
210
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
40
2.2k
Building an army of robots
kneath
306
46k
Building Applications with DynamoDB
mza
96
6.8k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
10
730
The Cult of Friendly URLs
andyhume
79
6.7k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
GraphQLとの向き合い方2022年版
quramy
50
14k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Navigating Team Friction
lara
191
16k
4 Signs Your Business is Dying
shpigford
186
22k
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
390
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