SlideShare a Scribd company logo
1 of 26
Connect Java EE to the Cloud
With JCA
Steve Millidge
(Founder Payara)
Agenda
• Payara Cloud Connectors
• What is JCA
• Fundamental Principals
• Relationship to MDBs
• Building Inbound Adapter
• Building Outbound Adapter
• Demo
What I wanted to do (Demo at the booth)
Clustered
CDI
Events
HumidityQ
Payara Micro Cluster
on Azure
JCA
Cloud
Connector
WebSocket
Web App
EJB Timer
Humidity
MDB
Grid Loader
Humidity
REST
Services
Cloud Connectors Project
Cloud Connectors
Deliver standard JCA connectors for Cloud Messaging
Kafka, Amazon SQS, Azure SB, MQTT
Payara Micro – Supports JCA Inbound/OutBound
JMS and JCA MDB
https://github.com/payara/Cloud-Connectors
What is the Java EE Connector
Architecture
The Java EE Connector
architecture defines a standard
architecture for connecting the
Java EE platform to heterogenous
Enterprise Information Systems
(EIS).
Source: JSR 322 Specification
Java Connector Architecture (JCA)
• Originally envisaged for Enterprise Application
Integration (EAI)
• 16 years Old JSR-16 September 2001
• Part of Java EE 8
• Last updated for Java EE 7 – May 2013
• Huge Specification – 592 pages!
• Pretty Generic – First look massively complex.
• MDBs and JDBC connection pools often JCA
A Pluggable Integration Component
Application Server
ResourceAdapter
Enterprise
Information
System
What does this look like
Application Server
Resource Adapter (RAR)
Inbound
Outbound
Connection
Pools
Thread
Pools
Message
Inflow
Deployment
Common API Layer
Key Contracts in JCA
• Lifecycle Management
• Configuration, Deployment, Boot, Shutdown
• Connection Management
• Connection creation, pooling destruction
• Work Management
• Threading
• Message Inflow
• Inbound Asynch Messaging
• Others not covered in the talk
• Security, Transactions, CCI
Key Java Beans
All Beans can use Bean Validation for setting their Properties.
Further configured via @ConfigProperty
Resource
Adapter
Activation
Spec
Managed Connection
Factory
Administered
Object
Java Beans inherit configuration from the Resource Adapter
Building a JCA Connector (Our Scenario)
Payara Micro Payara Micro
Resource Adapter (RAR)
Inbound
Outbound
Common API Layer
Resource Adapter (RAR)
Inbound
Outbound
Common API Layer
MQTT Topic
Outbound Inbound
Outbound Communication (Key Concepts)
Public API
Connection
Connection
Factory
RAR Internal Classes
ConnectionImpl
Connection
FactoryImpl
Managed
Connection
Managed
Connection
Factory
1*
11
Application Server
Connection
Manager
Key Class Responsibilities
Public API
Connection Factory
Application Developer
uses this to create
connections
Creates Connections using
the Application Server
Provided Connection
Manager
Connection
Application Developer
uses this api to interact
with the EIS
Connection Manager
Generic class provided by
the application server
runtime.
Interacts with your
Managed Connection
Factory to actually create
Physical Connections to
the EIS
Pools Managed
Connections using
Application Server Pooling
Application Server
Managed Connection
Factory
Creates Physical
connections to the EIS.
Interacts with your
Managed Connection
Factory to actually create
Physical Connections to
the EIS
Managed Connection
Is the connection to the
EIS
Resource Adapter
What Does Our Code Look Like?
public interface MQTTConnection extends AutoCloseable {
/**
* Publish a message on the MQTT topic
* @param topic Name of the topic to publish the message
* @param payload Byte array to use as message payload
* @param qos Quality of Service valid values are 0,1,2
* @param retained Whether or not this message should be retained by the server.
* @throws javax.resource.ResourceException
*/
public void publish(String topic, byte payload[], int qos, boolean retained) throws
ResourceException;
/**
* Publish a message on the MQTT topic
* @param topic
* @param message
* @throws ResourceException
*/
public void publish (String topic, MqttMessage message) throws
ResourceException;
/**
*
* @author Steve Millidge (Payara Foundation)
*/
public interface MQTTConnectionFactory {
public MQTTConnection getConnection();
}
Annotating Managed Connection Factory
/**
*
* @author Steve Millidge (Payara Foundation)
*/
@ConnectionDefinition (
connection = MQTTConnection.class,
connectionImpl = MQTTConnectionImpl.class,
connectionFactory = MQTTConnectionFactory.class,
connectionFactoryImpl = MQTTConnectionFactoryImpl.class
)
public class MQTTManagedConnectionFactory implements
ManagedConnectionFactory, Serializable {
@ConfigProperty
• Defines what Configuration is available
• Supports bean Validaion
• Types Valid for
• Resource Adapter
• Managed Connection Factory
• Administered Object
• Activation Spec
Outbound Code Walkthrough
https://github.com/payara/Cloud-
Connectors/tree/master/MQTT/MQTTJCAAPI/src/main/java/fish/payara/cloud/connectors
/mqtt/api/outbound
Inbound Communication Key Concepts
Public API
Listener
Interface
Message
Annotations
RAR Internal Classes
Activation
Spec
Resource
Adapter
Work
Application Server
Bootstrap
Context
Message Endpoint
Factory
Your
EIS integration
Class
Work Manager
Process of Boot and receipt of Messages
1. Resource Adapter start called with BootstrapContext
2. Application Server detects MDBs
3. Calls Resource Adapter for Each MDB passing in the
Endpoint Factory and Activation Spec
4. Resource Adapter creates an instance of your integration
class passing in the Activation Spec and Endpoint Factory
5. Your integration class connects to the EIS
Receipt of messages
1. When message received from the EIS
2. Schedule a unit of Work with the WorkManager
3. Unit of Work uses Endpoint Factory to create an endpoint
4. Calls Method on the endpoint
5. Releases the Endpoint
@Connector (Defines Resource Adapter)
@Connector(
displayName = "MQTT Resource Adapter",
vendorName = "Payara Services Limited",
version = "1.0" )
public class MQTTResourceAdapter implements
ResourceAdapter {
@ActivationSpec defined MDB Detection
@Activation(messageListeners = MQTTListener.class)
public class MQTTActivationSpec implements
ActivationSpec {
Also defines configuration Properties
Inbound Code Walkthrough
https://github.com/payara/Cloud-
Connectors/tree/master/MQTT/MQTTJCAAPI/src/main/java/fish/payara/cloud/connectors/
mqtt/api/inbound
Putting it all together
DEMO
Key Take Aways
MDBs are NOT just JMS
Payara Cloud Connectors Not just Payara
2 Sides to a JCA Adapter
Building JCA Adapters not Complex
Questions

More Related Content

What's hot

Java spring framework
Java spring frameworkJava spring framework
Java spring frameworkRajiv Gupta
 
Spring Mvc,Java, Spring
Spring Mvc,Java, SpringSpring Mvc,Java, Spring
Spring Mvc,Java, Springifnu bima
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework Serhat Can
 
If Hemingway Wrote JavaDocs
If Hemingway Wrote JavaDocsIf Hemingway Wrote JavaDocs
If Hemingway Wrote JavaDocsVMware Tanzu
 
Spring framework-tutorial
Spring framework-tutorialSpring framework-tutorial
Spring framework-tutorialvinayiqbusiness
 
Building web applications with Java & Spring
Building web applications with Java & SpringBuilding web applications with Java & Spring
Building web applications with Java & SpringDavid Kiss
 
Introduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoCIntroduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoCFunnelll
 
Spring introduction
Spring introductionSpring introduction
Spring introductionManav Prasad
 
Make Spring Home (Spring Customization and Extensibility)
Make Spring Home (Spring Customization and Extensibility)Make Spring Home (Spring Customization and Extensibility)
Make Spring Home (Spring Customization and Extensibility)VMware Tanzu
 
Spring Framework - Core
Spring Framework - CoreSpring Framework - Core
Spring Framework - CoreDzmitry Naskou
 
Spring Cloud: Why? How? What?
Spring Cloud: Why? How? What?Spring Cloud: Why? How? What?
Spring Cloud: Why? How? What?Orkhan Gasimov
 
Security Patterns for Microservice Architectures - SpringOne 2020
Security Patterns for Microservice Architectures - SpringOne 2020Security Patterns for Microservice Architectures - SpringOne 2020
Security Patterns for Microservice Architectures - SpringOne 2020Matt Raible
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework tola99
 

What's hot (18)

Java spring framework
Java spring frameworkJava spring framework
Java spring framework
 
Spring Mvc,Java, Spring
Spring Mvc,Java, SpringSpring Mvc,Java, Spring
Spring Mvc,Java, Spring
 
Spring to Image
Spring to ImageSpring to Image
Spring to Image
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Java Spring Framework
Java Spring FrameworkJava Spring Framework
Java Spring Framework
 
If Hemingway Wrote JavaDocs
If Hemingway Wrote JavaDocsIf Hemingway Wrote JavaDocs
If Hemingway Wrote JavaDocs
 
Spring framework-tutorial
Spring framework-tutorialSpring framework-tutorial
Spring framework-tutorial
 
Building web applications with Java & Spring
Building web applications with Java & SpringBuilding web applications with Java & Spring
Building web applications with Java & Spring
 
Introduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoCIntroduction to Spring Framework and Spring IoC
Introduction to Spring Framework and Spring IoC
 
Spring introduction
Spring introductionSpring introduction
Spring introduction
 
Spring Framework
Spring FrameworkSpring Framework
Spring Framework
 
Make Spring Home (Spring Customization and Extensibility)
Make Spring Home (Spring Customization and Extensibility)Make Spring Home (Spring Customization and Extensibility)
Make Spring Home (Spring Customization and Extensibility)
 
Spring Framework - Core
Spring Framework - CoreSpring Framework - Core
Spring Framework - Core
 
Spring Cloud: Why? How? What?
Spring Cloud: Why? How? What?Spring Cloud: Why? How? What?
Spring Cloud: Why? How? What?
 
Security Patterns for Microservice Architectures - SpringOne 2020
Security Patterns for Microservice Architectures - SpringOne 2020Security Patterns for Microservice Architectures - SpringOne 2020
Security Patterns for Microservice Architectures - SpringOne 2020
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework
 
Spring Framework Rohit
Spring Framework RohitSpring Framework Rohit
Spring Framework Rohit
 
Spring Framework Training Course
Spring Framework Training Course Spring Framework Training Course
Spring Framework Training Course
 

Similar to Connect JavaEE to the cloud with JCA by Steve Millidge

A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom Joshua Long
 
Spring Cloud Function & Project riff #jsug
Spring Cloud Function & Project riff #jsugSpring Cloud Function & Project riff #jsug
Spring Cloud Function & Project riff #jsugToshiaki Maki
 
Java Spring framework, Dependency Injection, DI, IoC, Inversion of Control
Java Spring framework, Dependency Injection, DI, IoC, Inversion of ControlJava Spring framework, Dependency Injection, DI, IoC, Inversion of Control
Java Spring framework, Dependency Injection, DI, IoC, Inversion of ControlArjun Thakur
 
SaaS transformation with OCE - uEngineCloud
SaaS transformation with OCE - uEngineCloudSaaS transformation with OCE - uEngineCloud
SaaS transformation with OCE - uEngineClouduEngine Solutions
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring FrameworkDineesha Suraweera
 
Deploying Elastic Java EE Microservices in the Cloud with Docker
Deploying Elastic Java EE Microservices in the Cloud with DockerDeploying Elastic Java EE Microservices in the Cloud with Docker
Deploying Elastic Java EE Microservices in the Cloud with DockerPayara
 
Pivoting Spring XD to Spring Cloud Data Flow with Sabby Anandan
Pivoting Spring XD to Spring Cloud Data Flow with Sabby AnandanPivoting Spring XD to Spring Cloud Data Flow with Sabby Anandan
Pivoting Spring XD to Spring Cloud Data Flow with Sabby AnandanPivotalOpenSourceHub
 
Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望 Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望 javatwo2011
 
Cloud Conference Day - A High-Speed Data Ingestion Service in Java Using MQTT...
Cloud Conference Day - A High-Speed Data Ingestion Service in Java Using MQTT...Cloud Conference Day - A High-Speed Data Ingestion Service in Java Using MQTT...
Cloud Conference Day - A High-Speed Data Ingestion Service in Java Using MQTT...Juarez Junior
 
Three Degrees of Mediation: Challenges and Lessons in building Cloud-agnostic...
Three Degrees of Mediation: Challenges and Lessons in building Cloud-agnostic...Three Degrees of Mediation: Challenges and Lessons in building Cloud-agnostic...
Three Degrees of Mediation: Challenges and Lessons in building Cloud-agnostic...Alex Maclinovsky
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEBenjamin Cabé
 
Spring tutorials
Spring tutorialsSpring tutorials
Spring tutorialsTIB Academy
 
Introduction to j2 ee frameworks
Introduction to j2 ee frameworksIntroduction to j2 ee frameworks
Introduction to j2 ee frameworksMukesh Kumar
 
"How to create an infrastructure in .NET", Leonid Chetverikov
"How to create an infrastructure in .NET", Leonid Chetverikov"How to create an infrastructure in .NET", Leonid Chetverikov
"How to create an infrastructure in .NET", Leonid ChetverikovFwdays
 
Whats Next for JCA?
Whats Next for JCA?Whats Next for JCA?
Whats Next for JCA?Fred Rowe
 

Similar to Connect JavaEE to the cloud with JCA by Steve Millidge (20)

A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom
 
SunMicroSystems
SunMicroSystemsSunMicroSystems
SunMicroSystems
 
Spring Cloud Function & Project riff #jsug
Spring Cloud Function & Project riff #jsugSpring Cloud Function & Project riff #jsug
Spring Cloud Function & Project riff #jsug
 
Java Spring framework, Dependency Injection, DI, IoC, Inversion of Control
Java Spring framework, Dependency Injection, DI, IoC, Inversion of ControlJava Spring framework, Dependency Injection, DI, IoC, Inversion of Control
Java Spring framework, Dependency Injection, DI, IoC, Inversion of Control
 
SaaS transformation with OCE - uEngineCloud
SaaS transformation with OCE - uEngineCloudSaaS transformation with OCE - uEngineCloud
SaaS transformation with OCE - uEngineCloud
 
Sunstate
SunstateSunstate
Sunstate
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Deploying Elastic Java EE Microservices in the Cloud with Docker
Deploying Elastic Java EE Microservices in the Cloud with DockerDeploying Elastic Java EE Microservices in the Cloud with Docker
Deploying Elastic Java EE Microservices in the Cloud with Docker
 
Pivoting Spring XD to Spring Cloud Data Flow with Sabby Anandan
Pivoting Spring XD to Spring Cloud Data Flow with Sabby AnandanPivoting Spring XD to Spring Cloud Data Flow with Sabby Anandan
Pivoting Spring XD to Spring Cloud Data Flow with Sabby Anandan
 
Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望 Java EE 與 雲端運算的展望
Java EE 與 雲端運算的展望
 
Cloud Conference Day - A High-Speed Data Ingestion Service in Java Using MQTT...
Cloud Conference Day - A High-Speed Data Ingestion Service in Java Using MQTT...Cloud Conference Day - A High-Speed Data Ingestion Service in Java Using MQTT...
Cloud Conference Day - A High-Speed Data Ingestion Service in Java Using MQTT...
 
Three Degrees of Mediation: Challenges and Lessons in building Cloud-agnostic...
Three Degrees of Mediation: Challenges and Lessons in building Cloud-agnostic...Three Degrees of Mediation: Challenges and Lessons in building Cloud-agnostic...
Three Degrees of Mediation: Challenges and Lessons in building Cloud-agnostic...
 
Use Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDEUse Eclipse technologies to build a modern embedded IDE
Use Eclipse technologies to build a modern embedded IDE
 
Spring tutorials
Spring tutorialsSpring tutorials
Spring tutorials
 
Introduction to j2 ee frameworks
Introduction to j2 ee frameworksIntroduction to j2 ee frameworks
Introduction to j2 ee frameworks
 
"How to create an infrastructure in .NET", Leonid Chetverikov
"How to create an infrastructure in .NET", Leonid Chetverikov"How to create an infrastructure in .NET", Leonid Chetverikov
"How to create an infrastructure in .NET", Leonid Chetverikov
 
Spring 2
Spring 2Spring 2
Spring 2
 
Spring framework
Spring frameworkSpring framework
Spring framework
 
Naresh_Profile
Naresh_ProfileNaresh_Profile
Naresh_Profile
 
Whats Next for JCA?
Whats Next for JCA?Whats Next for JCA?
Whats Next for JCA?
 

More from Payara

Easy Java Integration Testing with Testcontainers​
Easy Java Integration Testing with Testcontainers​Easy Java Integration Testing with Testcontainers​
Easy Java Integration Testing with Testcontainers​Payara
 
Payara Cloud - Cloud Native Jakarta EE.pptx
Payara Cloud - Cloud Native Jakarta EE.pptxPayara Cloud - Cloud Native Jakarta EE.pptx
Payara Cloud - Cloud Native Jakarta EE.pptxPayara
 
Jakarta Concurrency: Present and Future
Jakarta Concurrency: Present and FutureJakarta Concurrency: Present and Future
Jakarta Concurrency: Present and FuturePayara
 
GlassFish Migration Webinar 2022 Current version.pptx
GlassFish Migration Webinar 2022 Current version.pptxGlassFish Migration Webinar 2022 Current version.pptx
GlassFish Migration Webinar 2022 Current version.pptxPayara
 
10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...
10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...
10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...Payara
 
Securing Microservices with MicroProfile and Auth0v2
Securing Microservices with MicroProfile and Auth0v2Securing Microservices with MicroProfile and Auth0v2
Securing Microservices with MicroProfile and Auth0v2Payara
 
Reactive features of MicroProfile you need to learn
Reactive features of MicroProfile you need to learnReactive features of MicroProfile you need to learn
Reactive features of MicroProfile you need to learnPayara
 
Effective cloud-ready apps with MicroProfile
Effective cloud-ready apps with MicroProfileEffective cloud-ready apps with MicroProfile
Effective cloud-ready apps with MicroProfilePayara
 
A step-by-step guide from traditional Java EE to reactive microservice design
A step-by-step guide from traditional Java EE to reactive microservice designA step-by-step guide from traditional Java EE to reactive microservice design
A step-by-step guide from traditional Java EE to reactive microservice designPayara
 
Transactions in Microservices
Transactions in MicroservicesTransactions in Microservices
Transactions in MicroservicesPayara
 
Fun with Kubernetes and Payara Micro 5
Fun with Kubernetes and Payara Micro 5Fun with Kubernetes and Payara Micro 5
Fun with Kubernetes and Payara Micro 5Payara
 
What's new in Jakarta EE and Eclipse GlassFish (May 2019)
What's new in Jakarta EE and Eclipse GlassFish (May 2019)What's new in Jakarta EE and Eclipse GlassFish (May 2019)
What's new in Jakarta EE and Eclipse GlassFish (May 2019)Payara
 
Previewing Payara Platform 5.192
Previewing Payara Platform 5.192Previewing Payara Platform 5.192
Previewing Payara Platform 5.192Payara
 
Secure JAX-RS
Secure JAX-RSSecure JAX-RS
Secure JAX-RSPayara
 
Gradual Migration to MicroProfile
Gradual Migration to MicroProfileGradual Migration to MicroProfile
Gradual Migration to MicroProfilePayara
 
Monitor Microservices with MicroProfile Metrics
Monitor Microservices with MicroProfile MetricsMonitor Microservices with MicroProfile Metrics
Monitor Microservices with MicroProfile MetricsPayara
 
Java2 days -_be_reactive_and_micro_with_a_microprofile_stack
Java2 days -_be_reactive_and_micro_with_a_microprofile_stackJava2 days -_be_reactive_and_micro_with_a_microprofile_stack
Java2 days -_be_reactive_and_micro_with_a_microprofile_stackPayara
 
Java2 days 5_agile_steps_to_cloud-ready_apps
Java2 days 5_agile_steps_to_cloud-ready_appsJava2 days 5_agile_steps_to_cloud-ready_apps
Java2 days 5_agile_steps_to_cloud-ready_appsPayara
 
Rapid development tools for java ee 8 and micro profile [GIDS]
Rapid development tools for java ee 8 and micro profile [GIDS] Rapid development tools for java ee 8 and micro profile [GIDS]
Rapid development tools for java ee 8 and micro profile [GIDS] Payara
 
Ondrej mihalyi be reactive and micro with a micro profile stack
Ondrej mihalyi   be reactive and micro with a micro profile stackOndrej mihalyi   be reactive and micro with a micro profile stack
Ondrej mihalyi be reactive and micro with a micro profile stackPayara
 

More from Payara (20)

Easy Java Integration Testing with Testcontainers​
Easy Java Integration Testing with Testcontainers​Easy Java Integration Testing with Testcontainers​
Easy Java Integration Testing with Testcontainers​
 
Payara Cloud - Cloud Native Jakarta EE.pptx
Payara Cloud - Cloud Native Jakarta EE.pptxPayara Cloud - Cloud Native Jakarta EE.pptx
Payara Cloud - Cloud Native Jakarta EE.pptx
 
Jakarta Concurrency: Present and Future
Jakarta Concurrency: Present and FutureJakarta Concurrency: Present and Future
Jakarta Concurrency: Present and Future
 
GlassFish Migration Webinar 2022 Current version.pptx
GlassFish Migration Webinar 2022 Current version.pptxGlassFish Migration Webinar 2022 Current version.pptx
GlassFish Migration Webinar 2022 Current version.pptx
 
10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...
10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...
10 Strategies for Developing Reliable Jakarta EE & MicroProfile Applications ...
 
Securing Microservices with MicroProfile and Auth0v2
Securing Microservices with MicroProfile and Auth0v2Securing Microservices with MicroProfile and Auth0v2
Securing Microservices with MicroProfile and Auth0v2
 
Reactive features of MicroProfile you need to learn
Reactive features of MicroProfile you need to learnReactive features of MicroProfile you need to learn
Reactive features of MicroProfile you need to learn
 
Effective cloud-ready apps with MicroProfile
Effective cloud-ready apps with MicroProfileEffective cloud-ready apps with MicroProfile
Effective cloud-ready apps with MicroProfile
 
A step-by-step guide from traditional Java EE to reactive microservice design
A step-by-step guide from traditional Java EE to reactive microservice designA step-by-step guide from traditional Java EE to reactive microservice design
A step-by-step guide from traditional Java EE to reactive microservice design
 
Transactions in Microservices
Transactions in MicroservicesTransactions in Microservices
Transactions in Microservices
 
Fun with Kubernetes and Payara Micro 5
Fun with Kubernetes and Payara Micro 5Fun with Kubernetes and Payara Micro 5
Fun with Kubernetes and Payara Micro 5
 
What's new in Jakarta EE and Eclipse GlassFish (May 2019)
What's new in Jakarta EE and Eclipse GlassFish (May 2019)What's new in Jakarta EE and Eclipse GlassFish (May 2019)
What's new in Jakarta EE and Eclipse GlassFish (May 2019)
 
Previewing Payara Platform 5.192
Previewing Payara Platform 5.192Previewing Payara Platform 5.192
Previewing Payara Platform 5.192
 
Secure JAX-RS
Secure JAX-RSSecure JAX-RS
Secure JAX-RS
 
Gradual Migration to MicroProfile
Gradual Migration to MicroProfileGradual Migration to MicroProfile
Gradual Migration to MicroProfile
 
Monitor Microservices with MicroProfile Metrics
Monitor Microservices with MicroProfile MetricsMonitor Microservices with MicroProfile Metrics
Monitor Microservices with MicroProfile Metrics
 
Java2 days -_be_reactive_and_micro_with_a_microprofile_stack
Java2 days -_be_reactive_and_micro_with_a_microprofile_stackJava2 days -_be_reactive_and_micro_with_a_microprofile_stack
Java2 days -_be_reactive_and_micro_with_a_microprofile_stack
 
Java2 days 5_agile_steps_to_cloud-ready_apps
Java2 days 5_agile_steps_to_cloud-ready_appsJava2 days 5_agile_steps_to_cloud-ready_apps
Java2 days 5_agile_steps_to_cloud-ready_apps
 
Rapid development tools for java ee 8 and micro profile [GIDS]
Rapid development tools for java ee 8 and micro profile [GIDS] Rapid development tools for java ee 8 and micro profile [GIDS]
Rapid development tools for java ee 8 and micro profile [GIDS]
 
Ondrej mihalyi be reactive and micro with a micro profile stack
Ondrej mihalyi   be reactive and micro with a micro profile stackOndrej mihalyi   be reactive and micro with a micro profile stack
Ondrej mihalyi be reactive and micro with a micro profile stack
 

Recently uploaded

Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 

Recently uploaded (20)

The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 

Connect JavaEE to the cloud with JCA by Steve Millidge

  • 1. Connect Java EE to the Cloud With JCA Steve Millidge (Founder Payara)
  • 2. Agenda • Payara Cloud Connectors • What is JCA • Fundamental Principals • Relationship to MDBs • Building Inbound Adapter • Building Outbound Adapter • Demo
  • 3. What I wanted to do (Demo at the booth) Clustered CDI Events HumidityQ Payara Micro Cluster on Azure JCA Cloud Connector WebSocket Web App EJB Timer Humidity MDB Grid Loader Humidity REST Services
  • 4. Cloud Connectors Project Cloud Connectors Deliver standard JCA connectors for Cloud Messaging Kafka, Amazon SQS, Azure SB, MQTT Payara Micro – Supports JCA Inbound/OutBound JMS and JCA MDB https://github.com/payara/Cloud-Connectors
  • 5. What is the Java EE Connector Architecture The Java EE Connector architecture defines a standard architecture for connecting the Java EE platform to heterogenous Enterprise Information Systems (EIS). Source: JSR 322 Specification
  • 6. Java Connector Architecture (JCA) • Originally envisaged for Enterprise Application Integration (EAI) • 16 years Old JSR-16 September 2001 • Part of Java EE 8 • Last updated for Java EE 7 – May 2013 • Huge Specification – 592 pages! • Pretty Generic – First look massively complex. • MDBs and JDBC connection pools often JCA
  • 7. A Pluggable Integration Component Application Server ResourceAdapter Enterprise Information System
  • 8. What does this look like Application Server Resource Adapter (RAR) Inbound Outbound Connection Pools Thread Pools Message Inflow Deployment Common API Layer
  • 9. Key Contracts in JCA • Lifecycle Management • Configuration, Deployment, Boot, Shutdown • Connection Management • Connection creation, pooling destruction • Work Management • Threading • Message Inflow • Inbound Asynch Messaging • Others not covered in the talk • Security, Transactions, CCI
  • 10. Key Java Beans All Beans can use Bean Validation for setting their Properties. Further configured via @ConfigProperty Resource Adapter Activation Spec Managed Connection Factory Administered Object Java Beans inherit configuration from the Resource Adapter
  • 11. Building a JCA Connector (Our Scenario) Payara Micro Payara Micro Resource Adapter (RAR) Inbound Outbound Common API Layer Resource Adapter (RAR) Inbound Outbound Common API Layer MQTT Topic Outbound Inbound
  • 12. Outbound Communication (Key Concepts) Public API Connection Connection Factory RAR Internal Classes ConnectionImpl Connection FactoryImpl Managed Connection Managed Connection Factory 1* 11 Application Server Connection Manager
  • 13. Key Class Responsibilities Public API Connection Factory Application Developer uses this to create connections Creates Connections using the Application Server Provided Connection Manager Connection Application Developer uses this api to interact with the EIS Connection Manager Generic class provided by the application server runtime. Interacts with your Managed Connection Factory to actually create Physical Connections to the EIS Pools Managed Connections using Application Server Pooling Application Server Managed Connection Factory Creates Physical connections to the EIS. Interacts with your Managed Connection Factory to actually create Physical Connections to the EIS Managed Connection Is the connection to the EIS Resource Adapter
  • 14. What Does Our Code Look Like? public interface MQTTConnection extends AutoCloseable { /** * Publish a message on the MQTT topic * @param topic Name of the topic to publish the message * @param payload Byte array to use as message payload * @param qos Quality of Service valid values are 0,1,2 * @param retained Whether or not this message should be retained by the server. * @throws javax.resource.ResourceException */ public void publish(String topic, byte payload[], int qos, boolean retained) throws ResourceException; /** * Publish a message on the MQTT topic * @param topic * @param message * @throws ResourceException */ public void publish (String topic, MqttMessage message) throws ResourceException;
  • 15. /** * * @author Steve Millidge (Payara Foundation) */ public interface MQTTConnectionFactory { public MQTTConnection getConnection(); }
  • 16. Annotating Managed Connection Factory /** * * @author Steve Millidge (Payara Foundation) */ @ConnectionDefinition ( connection = MQTTConnection.class, connectionImpl = MQTTConnectionImpl.class, connectionFactory = MQTTConnectionFactory.class, connectionFactoryImpl = MQTTConnectionFactoryImpl.class ) public class MQTTManagedConnectionFactory implements ManagedConnectionFactory, Serializable {
  • 17. @ConfigProperty • Defines what Configuration is available • Supports bean Validaion • Types Valid for • Resource Adapter • Managed Connection Factory • Administered Object • Activation Spec
  • 19. Inbound Communication Key Concepts Public API Listener Interface Message Annotations RAR Internal Classes Activation Spec Resource Adapter Work Application Server Bootstrap Context Message Endpoint Factory Your EIS integration Class Work Manager
  • 20. Process of Boot and receipt of Messages 1. Resource Adapter start called with BootstrapContext 2. Application Server detects MDBs 3. Calls Resource Adapter for Each MDB passing in the Endpoint Factory and Activation Spec 4. Resource Adapter creates an instance of your integration class passing in the Activation Spec and Endpoint Factory 5. Your integration class connects to the EIS Receipt of messages 1. When message received from the EIS 2. Schedule a unit of Work with the WorkManager 3. Unit of Work uses Endpoint Factory to create an endpoint 4. Calls Method on the endpoint 5. Releases the Endpoint
  • 21. @Connector (Defines Resource Adapter) @Connector( displayName = "MQTT Resource Adapter", vendorName = "Payara Services Limited", version = "1.0" ) public class MQTTResourceAdapter implements ResourceAdapter {
  • 22. @ActivationSpec defined MDB Detection @Activation(messageListeners = MQTTListener.class) public class MQTTActivationSpec implements ActivationSpec { Also defines configuration Properties
  • 24. Putting it all together DEMO
  • 25. Key Take Aways MDBs are NOT just JMS Payara Cloud Connectors Not just Payara 2 Sides to a JCA Adapter Building JCA Adapters not Complex