SlideShare a Scribd company logo
Cloud-ready Micro Java EE 8
Ondro Mihályi | Payara Engineer
| @omihalyi
| @Payara_Fish
Who am I?
• Payara Engineer
• Java EE developer and lecturer
• Conference speaker
• Czech JUG leader
• Member of JCP and Eclipse foundation
• @omihalyi
What’s this all about?
• How lightweight is Java EE, really?
• What’s in Java EE 8 today?
• What could be in Java EE EE4J ??? in the future?
A little (recent) history...
• 12 June 2013: Java EE 7 Released
•Docker was 3 months old
•WildFly was still JBoss AS (and no Swarm)
•Before Spring Boot
•WebSphere Liberty Profile recently released
A little (recent) history...
• 21 September 2017: Java EE 8 Released, 4 years later
•Docker is now the dominant container format
•WildFly have fully product-ised WildFly Swarm
•Spring Boot have been making JARs not WARs for a few years
•IBM released Open Liberty
•Payara entered the fray and released Payara Micro
•Eclipse MicroProfile is established and progressing
What’s in Java EE 8?
• Upgrades
•JAX-RS 2.1
•Servlet 4.0
•Bean Validation 2.0
•JSF 2.3
•CDI 2.0
•JSON-P 1.1
• New
•Java EE Security
•JSON-B
What is Payara Micro?
• Payara Micro is…
•Micro! (~60MB disk size, ~30 MB RAM)
•Dynamically scalable
•Fully embeddable (if you want…)
•Web Profile “plus”
•On Maven Central
<dependency>
<groupId>fish.payara.api</groupId>
<ArtifactId>payara-api</artifactId>
<version>5.0.0-Alpha3</version>
<type>jar</type>
</dependency>
What is Payara Micro?
• Key APIs
• Servlets, JSTL, EL, JSP
• WebSockets
• JSF
• JAX-RS
• EJB Lite
• JTA
• JPA
• JCA (pluggable JMS)
• Bean Validation
• CDI
• Interceptors
• JBatch
• Concurrency
• JCache
• Config
• SOAP, remote EJB
Demo
Demo Scenario
• Stock! Micro Stock!
• Publish StockTicker events
• Listen on different endpoints
Demo Scenario
StockTickerStockTickerStockTicker
Produces Events
StockWeb
Consumes Events
Websocket Push
Demo 1
Creating the Stock Ticker
• What do we need?
• Stock object
• Stock Ticker to set the stock price
• Publisher for CDI event bus
Demo 2
Creating the Stock Web listener
• What do we need?
• Websocket endpoint
• Class to manage Websocket sessions
• Class to listen for Stock events on the CDI event bus
• Both these responsibilities can be in the same class
Integrating Java EE 8 Features
Demo
Making our MicroService generic
• What do we need to change?
• Non-Payara services can’t listen on the CDI event bus
• Solution: REST Server Sent Events (from JAX-RS 2.1)
• External services may not have access to a Stock object (or interface)
• Solution: Serialise our Stock object as JSON using JSON-B 1.0
private JsonObject toJson() {
JsonObjectBuilder objectBuilder = Json.createObjectBuilder()
.add("symbol", symbol)
.add("description", description)
.add("price", price);
return objectBuilder.build();
}
@Override
public String toString() {
return this.toJson().toString();
}
Demo 3 JSON-P manual toJson() method
@JsonbNillable
public class Stock implements Serializable {
private String symbol;
@JsonbTransient
private String description;
@JsonbProperty("RandomPrice")
private double price;
@Override
public String toString() {
JsonbConfig nillableConfig = new JsonbConfig().withNullValues(true);
return JsonbBuilder.create(nillableConfig).toJson(this);
}
}
private void observe() {
source.register((sseEvent)
-> {
this.stock = JsonbBuilder.create().fromJson(sseEvent.readData(), Stock.class);
});
source.open();
}
Demo 3 JSON-B serialisation and deserialisation
Learn more:
http://json-b.net
private void reactiveClient() {
CompletionStage<Response> cs1 = ClientBuilder.newClient()
.target("http://localhost:8080/jax-rs-2-1/books")
.request()
.rx()
.get();
CompletionStage<Response> cs2 = ClientBuilder.newClient()
.target("http://localhost:8080/jax-rs-2-1/magazines")
.request()
.rx()
.get();
cs1.thenCombine(cs2, (r1, r2) ->
r1.readEntity(String.class) + r2.readEntity(String.class))
.thenAccept(System.out::println);
}
Source: https://www.ibm.com/developerworks/library/j-whats-new-in-javaee-8/index.html
Author: Alex Theedom
Demo 4 JAX-RS reactive client API
Demo 4 SSE server endpoint in JAX-RS
@GET
@Produces(MediaType.SERVER_SENT_EVENTS)
public void eventOutput(@Context SseEventSink eventSink){
// send a single event
eventSink.send(sse.newEvent(stockTicker.getStock().toString()));
// registers the requester as a consumer of events
sseBroadcaster.register(eventSink);
}
@POST
@Path("broadcast")
@Consumes(MediaType.MULTIPART_FORM_DATA)
public void broadcast(@FormParam("event") String event){
// broadcasts the event to all registered consumers
sseBroadcaster.broadcast(sse.newEvent(event));
}
Demo 4
StockTickerStockTickerStockTicker
StockWeb
JAX-RS SSE
Client
Javascript SSE Client
The Future of Java EE…?
Demo 5
Integrating MicroProfile 1.1
<dependency>
<groupId>
org.eclipse.microprofile
</groupId>
<artifactId>
Microprofile-bom
</artifactId>
<version>1.1.0</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
@Inject
@ConfigProperty(name = "stockticker.url")
private String stockTickerURL;
@Inject
@ConfigProperty(name = "stockticker.url")
private Instance<String> tickerURLConfig;
...
String url = tickerURLConfig.get()
Demo 5
Integrating MicroProfile
// Set system property
java -jar -Dstockticker.url=http://localhost:8081/StockTicker-1.0-SNAPSHOT/rest/sse StockWeb/target/StockWeb-
1.0-SNAPSHOT-microbundle.jar
// Use asadmin to set property in Hazelcast cluster
asadmin> set-config-property
--propertyName=stockticker.url
--propertyValue=http://localhost:8080/StockTicker-1.0-SNAPSHOT/rest/sse
--source=cluster
// Use asadmin to set property for specific instances in Hazelcast cluster
asadmin> send-asadmin-command
--targets=‘*‘
--command=set-config-property
--
--propertyName=stockticker.url
--propertyValue=http://localhost:8080/StockTicker-1.0-SNAPSHOT/rest/sse
--source=config
--sourceName=sever-config
Recap
•Java EE is incredibly adaptable to changing needs
• Recent change has been driven by vendors’ implementations
• Eclipse MicroProfile offers interesting ideas for the future
Thank you!

More Related Content

What's hot

Hibernate
HibernateHibernate
Java solution
Java solutionJava solution
Java solution
1Arun_Pandey
 
Micronaut and the Power of Ahead of Time Compilation - Devnexus 2019
Micronaut and the Power of Ahead of Time Compilation - Devnexus 2019Micronaut and the Power of Ahead of Time Compilation - Devnexus 2019
Micronaut and the Power of Ahead of Time Compilation - Devnexus 2019
graemerocher
 
CIS 2015- Building IAM for OpenStack- Steve Martinelli
CIS 2015- Building IAM for OpenStack- Steve MartinelliCIS 2015- Building IAM for OpenStack- Steve Martinelli
CIS 2015- Building IAM for OpenStack- Steve Martinelli
CloudIDSummit
 
Microservice - Up to 500k CCU
Microservice - Up to 500k CCUMicroservice - Up to 500k CCU
Microservice - Up to 500k CCU
Viet Tran
 
Lift
LiftLift
Robe - A brand new robe for Dropwizard
Robe - A brand new robe for DropwizardRobe - A brand new robe for Dropwizard
Robe - A brand new robe for Dropwizard
Seray Uzgur
 
Akka.Net Overview
Akka.Net OverviewAkka.Net Overview
Akka.Net Overview
Geoffrey Vandiest
 
OSGi introduction
OSGi introductionOSGi introduction
OSGi introduction
Dario Bonino
 
Java onebrazil hk2
Java onebrazil hk2Java onebrazil hk2
Java onebrazil hk2
Jerome Dochez
 
Java introduction by lara technologies
Java introduction by lara technologiesJava introduction by lara technologies
Java introduction by lara technologies
technologieslara
 
Above and Beyond JDK 9, 10, 11, 12... - Branko Mihaljević and Martin Žagar on...
Above and Beyond JDK 9, 10, 11, 12... - Branko Mihaljević and Martin Žagar on...Above and Beyond JDK 9, 10, 11, 12... - Branko Mihaljević and Martin Žagar on...
Above and Beyond JDK 9, 10, 11, 12... - Branko Mihaljević and Martin Žagar on...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
Legacy To Docker - Lessons learned and demo of OpenUnison
Legacy To Docker - Lessons learned and demo of OpenUnisonLegacy To Docker - Lessons learned and demo of OpenUnison
Legacy To Docker - Lessons learned and demo of OpenUnison
Marc Boorshtein
 
Modular JavaScript
Modular JavaScriptModular JavaScript
Modular JavaScript
Sander Mak (@Sander_Mak)
 
OSGi compendium
OSGi compendiumOSGi compendium
OSGi compendium
Dario Bonino
 
Java programming and security
Java programming and securityJava programming and security
Java programming and security
UmeshchandraYadav5
 
Going Native With The OSGi Service Layer - Sascha Zelzer
Going Native With The OSGi Service Layer - Sascha ZelzerGoing Native With The OSGi Service Layer - Sascha Zelzer
Going Native With The OSGi Service Layer - Sascha Zelzer
mfrancis
 
WSO2 Microservices Framework for Java - Product Overview
WSO2 Microservices Framework for Java - Product OverviewWSO2 Microservices Framework for Java - Product Overview
WSO2 Microservices Framework for Java - Product Overview
WSO2
 

What's hot (18)

Hibernate
HibernateHibernate
Hibernate
 
Java solution
Java solutionJava solution
Java solution
 
Micronaut and the Power of Ahead of Time Compilation - Devnexus 2019
Micronaut and the Power of Ahead of Time Compilation - Devnexus 2019Micronaut and the Power of Ahead of Time Compilation - Devnexus 2019
Micronaut and the Power of Ahead of Time Compilation - Devnexus 2019
 
CIS 2015- Building IAM for OpenStack- Steve Martinelli
CIS 2015- Building IAM for OpenStack- Steve MartinelliCIS 2015- Building IAM for OpenStack- Steve Martinelli
CIS 2015- Building IAM for OpenStack- Steve Martinelli
 
Microservice - Up to 500k CCU
Microservice - Up to 500k CCUMicroservice - Up to 500k CCU
Microservice - Up to 500k CCU
 
Lift
LiftLift
Lift
 
Robe - A brand new robe for Dropwizard
Robe - A brand new robe for DropwizardRobe - A brand new robe for Dropwizard
Robe - A brand new robe for Dropwizard
 
Akka.Net Overview
Akka.Net OverviewAkka.Net Overview
Akka.Net Overview
 
OSGi introduction
OSGi introductionOSGi introduction
OSGi introduction
 
Java onebrazil hk2
Java onebrazil hk2Java onebrazil hk2
Java onebrazil hk2
 
Java introduction by lara technologies
Java introduction by lara technologiesJava introduction by lara technologies
Java introduction by lara technologies
 
Above and Beyond JDK 9, 10, 11, 12... - Branko Mihaljević and Martin Žagar on...
Above and Beyond JDK 9, 10, 11, 12... - Branko Mihaljević and Martin Žagar on...Above and Beyond JDK 9, 10, 11, 12... - Branko Mihaljević and Martin Žagar on...
Above and Beyond JDK 9, 10, 11, 12... - Branko Mihaljević and Martin Žagar on...
 
Legacy To Docker - Lessons learned and demo of OpenUnison
Legacy To Docker - Lessons learned and demo of OpenUnisonLegacy To Docker - Lessons learned and demo of OpenUnison
Legacy To Docker - Lessons learned and demo of OpenUnison
 
Modular JavaScript
Modular JavaScriptModular JavaScript
Modular JavaScript
 
OSGi compendium
OSGi compendiumOSGi compendium
OSGi compendium
 
Java programming and security
Java programming and securityJava programming and security
Java programming and security
 
Going Native With The OSGi Service Layer - Sascha Zelzer
Going Native With The OSGi Service Layer - Sascha ZelzerGoing Native With The OSGi Service Layer - Sascha Zelzer
Going Native With The OSGi Service Layer - Sascha Zelzer
 
WSO2 Microservices Framework for Java - Product Overview
WSO2 Microservices Framework for Java - Product OverviewWSO2 Microservices Framework for Java - Product Overview
WSO2 Microservices Framework for Java - Product Overview
 

Similar to Cloud-ready Micro Java EE 8

OTN Developer Days - Java EE 6
OTN Developer Days - Java EE 6OTN Developer Days - Java EE 6
OTN Developer Days - Java EE 6
glassfish
 
OpenNTF Webinar 2022-08 - XPages Jakarta EE Support in Practice
OpenNTF Webinar 2022-08 - XPages Jakarta EE Support in PracticeOpenNTF Webinar 2022-08 - XPages Jakarta EE Support in Practice
OpenNTF Webinar 2022-08 - XPages Jakarta EE Support in Practice
Jesse Gallagher
 
Bootstrapping a simple enterprise application with Java EE successor, Jakarta...
Bootstrapping a simple enterprise application with Java EE successor, Jakarta...Bootstrapping a simple enterprise application with Java EE successor, Jakarta...
Bootstrapping a simple enterprise application with Java EE successor, Jakarta...
Buhake Sindi
 
Spring framework
Spring frameworkSpring framework
Spring framework
Kani Selvam
 
Java EE8 - by Kito Mann
Java EE8 - by Kito Mann Java EE8 - by Kito Mann
Java EE8 - by Kito Mann
Kile Niklawski
 
JSF2
JSF2JSF2
Java EE Revisits GoF Design Patterns
Java EE Revisits GoF Design PatternsJava EE Revisits GoF Design Patterns
Java EE Revisits GoF Design Patterns
Murat Yener
 
Migrating to Jakarta EE 10
Migrating to Jakarta EE 10Migrating to Jakarta EE 10
Migrating to Jakarta EE 10
Josh Juneau
 
스프링 프레임워크
스프링 프레임워크스프링 프레임워크
스프링 프레임워크
Yoonki Chang
 
Spring MVC framework
Spring MVC frameworkSpring MVC framework
Spring MVC framework
Mohit Gupta
 
Voxxed Athens 2018 - Java EE is dead Long live jakarta EE!
Voxxed Athens 2018 - Java EE is dead Long live jakarta EE!Voxxed Athens 2018 - Java EE is dead Long live jakarta EE!
Voxxed Athens 2018 - Java EE is dead Long live jakarta EE!
Voxxed Athens
 
Sysco Oracle Tour 2016 - What's new in FMW 12.2.1?
Sysco Oracle Tour 2016 - What's new in FMW 12.2.1?Sysco Oracle Tour 2016 - What's new in FMW 12.2.1?
Sysco Oracle Tour 2016 - What's new in FMW 12.2.1?
Jon Petter Hjulstad
 
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client TechnologyRed Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Mark Proctor
 
Java EE 6, Eclipse @ EclipseCon
Java EE 6, Eclipse @ EclipseConJava EE 6, Eclipse @ EclipseCon
Java EE 6, Eclipse @ EclipseCon
Ludovic Champenois
 
Feature Bits at LSSC10
Feature  Bits at LSSC10Feature  Bits at LSSC10
Feature Bits at LSSC10
Erik Sowa
 
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGOverview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Marakana Inc.
 
Starting with jQuery
Starting with jQueryStarting with jQuery
Starting with jQuery
Anil Kumar
 
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Mihail Stoynov
 
The Java EE 6 platform
The Java EE 6 platformThe Java EE 6 platform
The Java EE 6 platform
Lorraine JUG
 
MicroProfile for MicroServices
MicroProfile for MicroServicesMicroProfile for MicroServices
MicroProfile for MicroServices
Mert Çalışkan
 

Similar to Cloud-ready Micro Java EE 8 (20)

OTN Developer Days - Java EE 6
OTN Developer Days - Java EE 6OTN Developer Days - Java EE 6
OTN Developer Days - Java EE 6
 
OpenNTF Webinar 2022-08 - XPages Jakarta EE Support in Practice
OpenNTF Webinar 2022-08 - XPages Jakarta EE Support in PracticeOpenNTF Webinar 2022-08 - XPages Jakarta EE Support in Practice
OpenNTF Webinar 2022-08 - XPages Jakarta EE Support in Practice
 
Bootstrapping a simple enterprise application with Java EE successor, Jakarta...
Bootstrapping a simple enterprise application with Java EE successor, Jakarta...Bootstrapping a simple enterprise application with Java EE successor, Jakarta...
Bootstrapping a simple enterprise application with Java EE successor, Jakarta...
 
Spring framework
Spring frameworkSpring framework
Spring framework
 
Java EE8 - by Kito Mann
Java EE8 - by Kito Mann Java EE8 - by Kito Mann
Java EE8 - by Kito Mann
 
JSF2
JSF2JSF2
JSF2
 
Java EE Revisits GoF Design Patterns
Java EE Revisits GoF Design PatternsJava EE Revisits GoF Design Patterns
Java EE Revisits GoF Design Patterns
 
Migrating to Jakarta EE 10
Migrating to Jakarta EE 10Migrating to Jakarta EE 10
Migrating to Jakarta EE 10
 
스프링 프레임워크
스프링 프레임워크스프링 프레임워크
스프링 프레임워크
 
Spring MVC framework
Spring MVC frameworkSpring MVC framework
Spring MVC framework
 
Voxxed Athens 2018 - Java EE is dead Long live jakarta EE!
Voxxed Athens 2018 - Java EE is dead Long live jakarta EE!Voxxed Athens 2018 - Java EE is dead Long live jakarta EE!
Voxxed Athens 2018 - Java EE is dead Long live jakarta EE!
 
Sysco Oracle Tour 2016 - What's new in FMW 12.2.1?
Sysco Oracle Tour 2016 - What's new in FMW 12.2.1?Sysco Oracle Tour 2016 - What's new in FMW 12.2.1?
Sysco Oracle Tour 2016 - What's new in FMW 12.2.1?
 
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client TechnologyRed Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
 
Java EE 6, Eclipse @ EclipseCon
Java EE 6, Eclipse @ EclipseConJava EE 6, Eclipse @ EclipseCon
Java EE 6, Eclipse @ EclipseCon
 
Feature Bits at LSSC10
Feature  Bits at LSSC10Feature  Bits at LSSC10
Feature Bits at LSSC10
 
Overview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUGOverview of Java EE 6 by Roberto Chinnici at SFJUG
Overview of Java EE 6 by Roberto Chinnici at SFJUG
 
Starting with jQuery
Starting with jQueryStarting with jQuery
Starting with jQuery
 
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
 
The Java EE 6 platform
The Java EE 6 platformThe Java EE 6 platform
The Java EE 6 platform
 
MicroProfile for MicroServices
MicroProfile for MicroServicesMicroProfile for MicroServices
MicroProfile for MicroServices
 

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

Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
Pravash Chandra Das
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
Hiroshi SHIBATA
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Tatiana Kojar
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
GDSC PJATK
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
flufftailshop
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 

Recently uploaded (20)

Operating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptxOperating System Used by Users in day-to-day life.pptx
Operating System Used by Users in day-to-day life.pptx
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Introduction of Cybersecurity with OSS at Code Europe 2024
Introduction of Cybersecurity with OSS  at Code Europe 2024Introduction of Cybersecurity with OSS  at Code Europe 2024
Introduction of Cybersecurity with OSS at Code Europe 2024
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!Finale of the Year: Apply for Next One!
Finale of the Year: Apply for Next One!
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 

Cloud-ready Micro Java EE 8

  • 1. Cloud-ready Micro Java EE 8 Ondro Mihályi | Payara Engineer | @omihalyi | @Payara_Fish
  • 2. Who am I? • Payara Engineer • Java EE developer and lecturer • Conference speaker • Czech JUG leader • Member of JCP and Eclipse foundation • @omihalyi
  • 3. What’s this all about? • How lightweight is Java EE, really? • What’s in Java EE 8 today? • What could be in Java EE EE4J ??? in the future?
  • 4. A little (recent) history... • 12 June 2013: Java EE 7 Released •Docker was 3 months old •WildFly was still JBoss AS (and no Swarm) •Before Spring Boot •WebSphere Liberty Profile recently released
  • 5. A little (recent) history... • 21 September 2017: Java EE 8 Released, 4 years later •Docker is now the dominant container format •WildFly have fully product-ised WildFly Swarm •Spring Boot have been making JARs not WARs for a few years •IBM released Open Liberty •Payara entered the fray and released Payara Micro •Eclipse MicroProfile is established and progressing
  • 6. What’s in Java EE 8? • Upgrades •JAX-RS 2.1 •Servlet 4.0 •Bean Validation 2.0 •JSF 2.3 •CDI 2.0 •JSON-P 1.1 • New •Java EE Security •JSON-B
  • 7. What is Payara Micro? • Payara Micro is… •Micro! (~60MB disk size, ~30 MB RAM) •Dynamically scalable •Fully embeddable (if you want…) •Web Profile “plus” •On Maven Central <dependency> <groupId>fish.payara.api</groupId> <ArtifactId>payara-api</artifactId> <version>5.0.0-Alpha3</version> <type>jar</type> </dependency>
  • 8. What is Payara Micro? • Key APIs • Servlets, JSTL, EL, JSP • WebSockets • JSF • JAX-RS • EJB Lite • JTA • JPA • JCA (pluggable JMS) • Bean Validation • CDI • Interceptors • JBatch • Concurrency • JCache • Config • SOAP, remote EJB
  • 10. Demo Scenario • Stock! Micro Stock! • Publish StockTicker events • Listen on different endpoints
  • 12. Demo 1 Creating the Stock Ticker • What do we need? • Stock object • Stock Ticker to set the stock price • Publisher for CDI event bus
  • 13. Demo 2 Creating the Stock Web listener • What do we need? • Websocket endpoint • Class to manage Websocket sessions • Class to listen for Stock events on the CDI event bus • Both these responsibilities can be in the same class
  • 14. Integrating Java EE 8 Features
  • 15. Demo Making our MicroService generic • What do we need to change? • Non-Payara services can’t listen on the CDI event bus • Solution: REST Server Sent Events (from JAX-RS 2.1) • External services may not have access to a Stock object (or interface) • Solution: Serialise our Stock object as JSON using JSON-B 1.0
  • 16. private JsonObject toJson() { JsonObjectBuilder objectBuilder = Json.createObjectBuilder() .add("symbol", symbol) .add("description", description) .add("price", price); return objectBuilder.build(); } @Override public String toString() { return this.toJson().toString(); } Demo 3 JSON-P manual toJson() method
  • 17. @JsonbNillable public class Stock implements Serializable { private String symbol; @JsonbTransient private String description; @JsonbProperty("RandomPrice") private double price; @Override public String toString() { JsonbConfig nillableConfig = new JsonbConfig().withNullValues(true); return JsonbBuilder.create(nillableConfig).toJson(this); } } private void observe() { source.register((sseEvent) -> { this.stock = JsonbBuilder.create().fromJson(sseEvent.readData(), Stock.class); }); source.open(); } Demo 3 JSON-B serialisation and deserialisation Learn more: http://json-b.net
  • 18. private void reactiveClient() { CompletionStage<Response> cs1 = ClientBuilder.newClient() .target("http://localhost:8080/jax-rs-2-1/books") .request() .rx() .get(); CompletionStage<Response> cs2 = ClientBuilder.newClient() .target("http://localhost:8080/jax-rs-2-1/magazines") .request() .rx() .get(); cs1.thenCombine(cs2, (r1, r2) -> r1.readEntity(String.class) + r2.readEntity(String.class)) .thenAccept(System.out::println); } Source: https://www.ibm.com/developerworks/library/j-whats-new-in-javaee-8/index.html Author: Alex Theedom Demo 4 JAX-RS reactive client API
  • 19. Demo 4 SSE server endpoint in JAX-RS @GET @Produces(MediaType.SERVER_SENT_EVENTS) public void eventOutput(@Context SseEventSink eventSink){ // send a single event eventSink.send(sse.newEvent(stockTicker.getStock().toString())); // registers the requester as a consumer of events sseBroadcaster.register(eventSink); } @POST @Path("broadcast") @Consumes(MediaType.MULTIPART_FORM_DATA) public void broadcast(@FormParam("event") String event){ // broadcasts the event to all registered consumers sseBroadcaster.broadcast(sse.newEvent(event)); }
  • 21. The Future of Java EE…?
  • 22. Demo 5 Integrating MicroProfile 1.1 <dependency> <groupId> org.eclipse.microprofile </groupId> <artifactId> Microprofile-bom </artifactId> <version>1.1.0</version> <type>pom</type> <scope>provided</scope> </dependency> @Inject @ConfigProperty(name = "stockticker.url") private String stockTickerURL; @Inject @ConfigProperty(name = "stockticker.url") private Instance<String> tickerURLConfig; ... String url = tickerURLConfig.get()
  • 23. Demo 5 Integrating MicroProfile // Set system property java -jar -Dstockticker.url=http://localhost:8081/StockTicker-1.0-SNAPSHOT/rest/sse StockWeb/target/StockWeb- 1.0-SNAPSHOT-microbundle.jar // Use asadmin to set property in Hazelcast cluster asadmin> set-config-property --propertyName=stockticker.url --propertyValue=http://localhost:8080/StockTicker-1.0-SNAPSHOT/rest/sse --source=cluster // Use asadmin to set property for specific instances in Hazelcast cluster asadmin> send-asadmin-command --targets=‘*‘ --command=set-config-property -- --propertyName=stockticker.url --propertyValue=http://localhost:8080/StockTicker-1.0-SNAPSHOT/rest/sse --source=config --sourceName=sever-config
  • 24. Recap •Java EE is incredibly adaptable to changing needs • Recent change has been driven by vendors’ implementations • Eclipse MicroProfile offers interesting ideas for the future