SlideShare a Scribd company logo
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 framework
Rajiv Gupta
 
Spring Mvc,Java, Spring
Spring Mvc,Java, SpringSpring Mvc,Java, Spring
Spring Mvc,Java, Spring
ifnu bima
 
Spring to Image
Spring to ImageSpring to Image
Spring to Image
VMware Tanzu
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
Serhat Can
 
Java Spring Framework
Java Spring FrameworkJava Spring Framework
Java Spring Framework
Mehul Jariwala
 
If Hemingway Wrote JavaDocs
If Hemingway Wrote JavaDocsIf Hemingway Wrote JavaDocs
If Hemingway Wrote JavaDocs
VMware Tanzu
 
Spring framework-tutorial
Spring framework-tutorialSpring framework-tutorial
Spring framework-tutorial
vinayiqbusiness
 
Building web applications with Java & Spring
Building web applications with Java & SpringBuilding web applications with Java & Spring
Building web applications with Java & Spring
David 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 IoC
Funnelll
 
Spring introduction
Spring introductionSpring introduction
Spring introduction
Manav Prasad
 
Spring Framework
Spring FrameworkSpring Framework
Spring Framework
NexThoughts Technologies
 
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 - Core
Dzmitry 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 2020
Matt Raible
 
Spring Framework
Spring Framework  Spring Framework
Spring Framework
tola99
 
Spring Framework Training Course
Spring Framework Training Course Spring Framework Training Course
Spring Framework Training Course
RMS Software Technologies
 

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
 
SunMicroSystems
SunMicroSystemsSunMicroSystems
SunMicroSystems
Khasim Cise
 
Spring Cloud Function & Project riff #jsug
Spring Cloud Function & Project riff #jsugSpring Cloud Function & Project riff #jsug
Spring Cloud Function & Project riff #jsug
Toshiaki 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 Control
Arjun Thakur
 
SaaS transformation with OCE - uEngineCloud
SaaS transformation with OCE - uEngineCloudSaaS transformation with OCE - uEngineCloud
SaaS transformation with OCE - uEngineClouduEngine Solutions
 
Sunstate
SunstateSunstate
Sunstate
Mohammed625
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
Dineesha 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 Docker
Payara
 
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
PivotalOpenSourceHub
 
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 tutorials
TIB Academy
 
Introduction to j2 ee frameworks
Introduction to j2 ee frameworksIntroduction to j2 ee frameworks
Introduction to j2 ee frameworks
Mukesh 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 Chetverikov
Fwdays
 
Spring framework
Spring frameworkSpring framework
Spring framework
Rajkumar Singh
 
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.pptx
Payara
 
Jakarta Concurrency: Present and Future
Jakarta Concurrency: Present and FutureJakarta Concurrency: Present and Future
Jakarta Concurrency: Present and Future
Payara
 
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
Payara
 
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 Auth0v2
Payara
 
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
Payara
 
Effective cloud-ready apps with MicroProfile
Effective cloud-ready apps with MicroProfileEffective cloud-ready apps with MicroProfile
Effective cloud-ready apps with MicroProfile
Payara
 
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
Payara
 
Transactions in Microservices
Transactions in MicroservicesTransactions in Microservices
Transactions in Microservices
Payara
 
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
Payara
 
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.192
Payara
 
Secure JAX-RS
Secure JAX-RSSecure JAX-RS
Secure JAX-RS
Payara
 
Gradual Migration to MicroProfile
Gradual Migration to MicroProfileGradual Migration to MicroProfile
Gradual Migration to MicroProfile
Payara
 
Monitor Microservices with MicroProfile Metrics
Monitor Microservices with MicroProfile MetricsMonitor Microservices with MicroProfile Metrics
Monitor Microservices with MicroProfile Metrics
Payara
 
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
Payara
 
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
Payara
 
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 stack
Payara
 

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

FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
Ralf Eggert
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
Vlad Stirbu
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
ViralQR
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Assure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyesAssure Contact Center Experiences for Your Customers With ThousandEyes
Assure Contact Center Experiences for Your Customers With ThousandEyes
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)PHP Frameworks: I want to break free (IPC Berlin 2024)
PHP Frameworks: I want to break free (IPC Berlin 2024)
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
Quantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIsQuantum Computing: Current Landscape and the Future Role of APIs
Quantum Computing: Current Landscape and the Future Role of APIs
 
Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.Welocme to ViralQR, your best QR code generator.
Welocme to ViralQR, your best QR code generator.
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 

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