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
92
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
57
Life of our small product
khasunuma
0
46
How to adapt MicroProfile API for generic Web applications
khasunuma
0
43
Overviewing Admin Console
khasunuma
0
42
Introduction to MicroProfile Metrics
khasunuma
0
65
Basic method for Java EE Web Profile
khasunuma
0
40
Collections Framework Begineers Guide 2
khasunuma
0
81
JLS myths ~ if-then-else statement ~
khasunuma
0
51
Introduction to Date and Time API 4
khasunuma
0
77
Other Decks in Programming
See All in Programming
Going Multiplatform with Your Android App (Android Makers 2026)
zsmb
2
420
JAWS-UG横浜 #100 祝・第100回スペシャルAWS は VPC レスの時代へ
maroon1st
0
140
AWS re:Invent 2025の少し振り返り + DevOps AgentとBacklogを連携させてみた
satoshi256kbyte
3
160
Swift Concurrency Type System
inamiy
0
530
How We Benchmarked Quarkus: Patterns and anti-patterns
hollycummins
1
140
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
2
370
Vibe NLP for Applied NLP
inesmontani
PRO
0
430
TiDBのアーキテクチャから学ぶ分散システム入門 〜MySQL互換のNewSQLは何を解決するのか〜 / tidb-architecture-study
dznbk
1
180
ハンズオンで学ぶクラウドネイティブ
tatsukiminami
0
130
Offline should be the norm: building local-first apps with CRDTs & Kotlin Multiplatform
renaudmathieu
0
210
瑠璃の宝石に学ぶ技術の声の聴き方 / 【劇場版】アニメから得た学びを発表会2026 #エンジニアニメ
mazrean
0
250
GitHubCopilotCLIをはじめよう.pdf
htkym
0
140
Featured
See All Featured
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
170
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
250
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
110
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
210
Accessibility Awareness
sabderemane
0
100
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.9k
Optimising Largest Contentful Paint
csswizardry
37
3.6k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
30k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
180
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.2k
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