SlideShare a Scribd company logo
Jakarta EE & MicroProfile
2
About Us
Josh Juneau
Application Developer
Database Administrator
Author, Blogger, Podcaster
Apache NetBeans Committer/Java
Champions/Jakarta EE Guardians
Chicago Java Users Group Executive Board
Edwin Derks
Software Architect
Author, Blogger, Speaker
Contributor for Jakarta EE
Committer for MicroProfile
Member of Jakarta EE Guardians
@edwinderks
Jakarta EE and MicroProfile - EclipseCon 2020
4
Agenda
- Demonstrate some cool features with Jakarta EE and MicroProfile that you
don't use everyday
- We will monitor the Q&A in order to answer your questions and feedback
during the session
5
Jakarta EE 9
6
Get Started Today
Download GlassFish 6, Payara Runtime and others?
Incorporate the dependencies into your project...the examples in this presentation
use Jakarta EE 8.
Jakarta EE 9 will NOT be backward compatible with Jakarta EE 8.
Specification Documents
Examples for this demo:
https://github.com/juneau001/JakartaEE-MicroProfile-Demos
7
Jakarta EE 9 Overview
Namespace Change
● javax.* to jakarta.*
Specification Documents
Java SE 11 may not be available out of gate, but will be with Jakarta EE 9.1
8
Jakarta CDI
Latest Additions:
- Modularization, support for Java SE
- Observers Ordering
- Asynchronous Events
- Configurators for major SPI elements
- Configure or Veto Observer Methods
- Apply Interceptor on Producers
9
Jakarta CDI - Async
How does one mark a CDI event as asynchronous?
Solution:
Fire the event calling upon the fireAsync() method, passing the event class.
10
Jakarta CDI - Async
Example of logging on event execution:
Utilize @ObservesAsync to reserve an asynchronous event.
11
Jakarta JSON Binding
Standard binding layer for converting Java objects to/from JSON.
- Serialize/de-serialize objects to/from JSON
- Mapping of Primitive Types
- Serialize Collections and Maps
12
Jakarta JSON Binding
Read a JSON document and convert it into a Java object
Utilize default JSON binding mapping to quickly map a POJO.
13
Jakarta JSON Binding
Create JSON from a Java Object
14
Jakarta JSON Processing
- Jakarta EE provides an API to parse, transform, and query JSON data using
the object model or streaming model
- JsonObjectBuilder is used to build a JSON object
- Call upon the Json.createObjectBuilder() method to create a
JsonObjectBuilder.
- Call upon the Json.createArrayBuilder() method to create a JsonArray
15
Jakarta JSON Processing
JSON Pointer and JSON Patch
JSON Pointer allows one to point to a particular element within a JSON Structure
Utilize JSON Patch to replace a specified value within a JSON document with
another value.
- Editing/Transformation Operations Added to the JSON Object Model
JSON defines only two data structures: Objects, Arrays
JSON define seven value types: String, number, object, array, true, false, null
16
Jakarta Server Faces
LocalDateTime Conversion
Ability to convert Date-Time API values to/from expression language
JSF as Microservices Front End
The examples utilize JSF views and @ViewScoped controller classes to interact
with remote web services, which in-turn, performs transactions against an
RDBMS..
17
Jakarta RESTful Web Services
JAX-RS Client
The examples utilize JSF views and @ViewScoped controller classes to interact
with remote web services to update the database.
18
Jakarta RESTful Web Services
Server Sent Events
- One way communication channel
- Text protocol, “text/event-stream” media type
- Multiple Messages
- Retry interval
SSEEventSink used to send stream of messages
SSEEvent is base event class, OutboundSseEvent packages an event
19
Jakarta Security
Standard Security Provided
- Ability to apply across multiple identity stores: Database, LDAP, Embedded
- Annotations for ease of development
- Remembers caller (cookie, identity store)
- Group to Role Mapping
- Standard expression language accessors
- Simplified HttpAuthenticationMechanism interface with three default
implementations: basic, form, LDAP
20
Jakarta Bean Validation
Validate field content using simple annotations
- Support for more flexible cascaded validation of constraint types
- Support for java.util.Optional
- Support for @Past and @Future
- New annotations: @Email, @NotEmpty, @NotBlank, @Positive,
@PositiveOrZero, @Negative, @NegativeOrZero, @PastOrPresent,
@FutureOrPresent
21
Jakarta Persistence
Updated in latest releases:
- Streams
- Repeatable Annotations
- Date-Time API
- CDI Injection in AttributeConverters
22
Jakarta WebSockets
Full-Duplex Communication Between Peers
- Create a WebSocket endpoint by annotating a POJO with @ServerEndpoint
- Create a message receiver method and annotate with @OnMessage
- Supports:
- @OnOpen
- @OnError
23
MicroProfile
24
MicroProfile - Health
Health probes for Kubernetes
- Liveness vs Readiness probes
- liveness probe; restart container when not healthy
- readiness probe; when container is ready to receive traffic
Example:
- Programmatic readiness probe
25
MicroProfile - Config
Property injection
- This specification is not part of the Jakarta EE (yet)
- Spring Framework/Boot does also contain this feature
- Can inject properties provided by the app or the environment, like Kubernetes
Example: Inject in Jakarta EE JAX-RS endpoint
- This is an example of where Jakarta EE and MicroProfile complement each other
MicroProfile - RestClient
HTTP client specification
- JAX-RS and MP RestClient both have programmatic client
- MP RestClient can annotate interfaces
Example:
- Use CDI and MP Config to inject the MP RestClient with an
environment-specific URL
MicroProfile - FaultTolerance
Increase the success rate of your requests by adding resilience to requests
Good practice to add:
- @Retry how many times will the request be repeated on error
- @Timeout how long will the client wait for a response
- @Fallback what will the behaviour be when no retries are left
MicroProfile - FaultTolerance
Increase the success rate of your requests by adding resilience to requests
More advanced tuning of resilience:
- @CircuitBreaker fail incoming requests when calls to a downstream service
are subsequently failing over a defined threshold
- @Bulkhead Limit concurrent requests to a downstream service
29
Infrastructure
Docker Image
Ship your dependencies as part of the infrastructure
- Download and ship project's dependency to the Docker Image
31
@EclipseCon | #EclipseCon
-1 0 +1

More Related Content

PDF
Jakarta EE and MicroProfile Tech Talk
PPTX
Jakarta EE: Today and Tomorrow
PPTX
Jakarta EE 8: Overview of Features
PDF
Cloud Native Java: Present and Future at Eclipse Foundation
PDF
Java EE 7 from an HTML5 Perspective, JavaLand 2015
PPT
Jetspeed-2 Overview
PDF
Burns jsf-confess-2015
PPTX
Introduce yourself to java 17
Jakarta EE and MicroProfile Tech Talk
Jakarta EE: Today and Tomorrow
Jakarta EE 8: Overview of Features
Cloud Native Java: Present and Future at Eclipse Foundation
Java EE 7 from an HTML5 Perspective, JavaLand 2015
Jetspeed-2 Overview
Burns jsf-confess-2015
Introduce yourself to java 17

What's hot (20)

PDF
DevNexus 2019: MicroProfile and Jakarta EE - What's Next?
PDF
Implementing Microservices with Jakarta EE and MicroProfile
PPTX
Spring andspringboot training
PDF
JSF 2.2 Input Output JavaLand 2015
PDF
Top 8 benefits of react js
PDF
JDK versions and OpenJDK
PPTX
Community vs. Commercial Open Source
PPTX
Comparison between Oracle JDK, Oracle OpenJDK, and Red Hat OpenJDK
PPTX
Liferay 7
PDF
Spring Framework 5.2: Core Container Revisited
PPTX
Liferay Configuration and Customization
PDF
Serverless Spring
PPTX
Ed presents JSF 2.2 and WebSocket to Gameduell.
PPTX
Liferay on docker
PDF
Java Enterprise Edition 6 Overview
DOCX
Brouchure
PDF
EJB and CDI - Alignment and Strategy
PPTX
WebLogic Developer Experience and Java EE 6
PDF
API Design Principles Essential 
PDF
JDK 10 Java Module System
DevNexus 2019: MicroProfile and Jakarta EE - What's Next?
Implementing Microservices with Jakarta EE and MicroProfile
Spring andspringboot training
JSF 2.2 Input Output JavaLand 2015
Top 8 benefits of react js
JDK versions and OpenJDK
Community vs. Commercial Open Source
Comparison between Oracle JDK, Oracle OpenJDK, and Red Hat OpenJDK
Liferay 7
Spring Framework 5.2: Core Container Revisited
Liferay Configuration and Customization
Serverless Spring
Ed presents JSF 2.2 and WebSocket to Gameduell.
Liferay on docker
Java Enterprise Edition 6 Overview
Brouchure
EJB and CDI - Alignment and Strategy
WebLogic Developer Experience and Java EE 6
API Design Principles Essential 
JDK 10 Java Module System
Ad

Similar to Jakarta EE and MicroProfile - EclipseCon 2020 (20)

PDF
Migrating to Jakarta EE 10
PDF
InterConnect 2016 Java EE 7 Overview (PEJ-5296)
PDF
exploring-spring-boot-clients.pdf Spring Boot
ODP
springmvc-150923124312-lva1-app6892
ODP
Java Spring MVC Framework with AngularJS by Google and HTML5
PPTX
PPTX
Java ee7 1hour
PPTX
Jakarta Concurrency: Present and Future
PPTX
Getting Started with Java EE 7
PDF
Spring Boot 3 And Beyond
PDF
Haj 4328-java ee 7 overview
PPTX
Intro react js
PDF
Utilizing JSF Front Ends with Microservices
PDF
React JS Interview Questions PDF By ScholarHat
DOCX
CV_PrasantKumar
PPTX
Plone FSR
PDF
Spring Update | July 2023
PDF
Get Hip with JHipster - GIDS 2019
PDF
Java EE 8 Recipes
PPTX
reactJS
Migrating to Jakarta EE 10
InterConnect 2016 Java EE 7 Overview (PEJ-5296)
exploring-spring-boot-clients.pdf Spring Boot
springmvc-150923124312-lva1-app6892
Java Spring MVC Framework with AngularJS by Google and HTML5
Java ee7 1hour
Jakarta Concurrency: Present and Future
Getting Started with Java EE 7
Spring Boot 3 And Beyond
Haj 4328-java ee 7 overview
Intro react js
Utilizing JSF Front Ends with Microservices
React JS Interview Questions PDF By ScholarHat
CV_PrasantKumar
Plone FSR
Spring Update | July 2023
Get Hip with JHipster - GIDS 2019
Java EE 8 Recipes
reactJS
Ad

More from Josh Juneau (6)

PDF
Jakarta EE Recipes
PDF
Lightweight Java EE with MicroProfile
PDF
Java EE 8 Web Frameworks: A Look at JSF vs MVC
PDF
Java EE 8: On the Horizon
PDF
Java EE 7 Recipes
PDF
Java EE 7 Recipes for Concurrency - JavaOne 2014
Jakarta EE Recipes
Lightweight Java EE with MicroProfile
Java EE 8 Web Frameworks: A Look at JSF vs MVC
Java EE 8: On the Horizon
Java EE 7 Recipes
Java EE 7 Recipes for Concurrency - JavaOne 2014

Recently uploaded (20)

PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
cuic standard and advanced reporting.pdf
PPTX
SOPHOS-XG Firewall Administrator PPT.pptx
PDF
Encapsulation theory and applications.pdf
PPTX
A Presentation on Artificial Intelligence
PPTX
Machine Learning_overview_presentation.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Getting Started with Data Integration: FME Form 101
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Programs and apps: productivity, graphics, security and other tools
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
cuic standard and advanced reporting.pdf
SOPHOS-XG Firewall Administrator PPT.pptx
Encapsulation theory and applications.pdf
A Presentation on Artificial Intelligence
Machine Learning_overview_presentation.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Reach Out and Touch Someone: Haptics and Empathic Computing
Getting Started with Data Integration: FME Form 101
Mobile App Security Testing_ A Comprehensive Guide.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
MYSQL Presentation for SQL database connectivity
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Network Security Unit 5.pdf for BCA BBA.
Advanced methodologies resolving dimensionality complications for autism neur...
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Machine learning based COVID-19 study performance prediction
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...

Jakarta EE and MicroProfile - EclipseCon 2020

  • 1. Jakarta EE & MicroProfile
  • 2. 2 About Us Josh Juneau Application Developer Database Administrator Author, Blogger, Podcaster Apache NetBeans Committer/Java Champions/Jakarta EE Guardians Chicago Java Users Group Executive Board Edwin Derks Software Architect Author, Blogger, Speaker Contributor for Jakarta EE Committer for MicroProfile Member of Jakarta EE Guardians @edwinderks
  • 4. 4 Agenda - Demonstrate some cool features with Jakarta EE and MicroProfile that you don't use everyday - We will monitor the Q&A in order to answer your questions and feedback during the session
  • 6. 6 Get Started Today Download GlassFish 6, Payara Runtime and others? Incorporate the dependencies into your project...the examples in this presentation use Jakarta EE 8. Jakarta EE 9 will NOT be backward compatible with Jakarta EE 8. Specification Documents Examples for this demo: https://github.com/juneau001/JakartaEE-MicroProfile-Demos
  • 7. 7 Jakarta EE 9 Overview Namespace Change ● javax.* to jakarta.* Specification Documents Java SE 11 may not be available out of gate, but will be with Jakarta EE 9.1
  • 8. 8 Jakarta CDI Latest Additions: - Modularization, support for Java SE - Observers Ordering - Asynchronous Events - Configurators for major SPI elements - Configure or Veto Observer Methods - Apply Interceptor on Producers
  • 9. 9 Jakarta CDI - Async How does one mark a CDI event as asynchronous? Solution: Fire the event calling upon the fireAsync() method, passing the event class.
  • 10. 10 Jakarta CDI - Async Example of logging on event execution: Utilize @ObservesAsync to reserve an asynchronous event.
  • 11. 11 Jakarta JSON Binding Standard binding layer for converting Java objects to/from JSON. - Serialize/de-serialize objects to/from JSON - Mapping of Primitive Types - Serialize Collections and Maps
  • 12. 12 Jakarta JSON Binding Read a JSON document and convert it into a Java object Utilize default JSON binding mapping to quickly map a POJO.
  • 13. 13 Jakarta JSON Binding Create JSON from a Java Object
  • 14. 14 Jakarta JSON Processing - Jakarta EE provides an API to parse, transform, and query JSON data using the object model or streaming model - JsonObjectBuilder is used to build a JSON object - Call upon the Json.createObjectBuilder() method to create a JsonObjectBuilder. - Call upon the Json.createArrayBuilder() method to create a JsonArray
  • 15. 15 Jakarta JSON Processing JSON Pointer and JSON Patch JSON Pointer allows one to point to a particular element within a JSON Structure Utilize JSON Patch to replace a specified value within a JSON document with another value. - Editing/Transformation Operations Added to the JSON Object Model JSON defines only two data structures: Objects, Arrays JSON define seven value types: String, number, object, array, true, false, null
  • 16. 16 Jakarta Server Faces LocalDateTime Conversion Ability to convert Date-Time API values to/from expression language JSF as Microservices Front End The examples utilize JSF views and @ViewScoped controller classes to interact with remote web services, which in-turn, performs transactions against an RDBMS..
  • 17. 17 Jakarta RESTful Web Services JAX-RS Client The examples utilize JSF views and @ViewScoped controller classes to interact with remote web services to update the database.
  • 18. 18 Jakarta RESTful Web Services Server Sent Events - One way communication channel - Text protocol, “text/event-stream” media type - Multiple Messages - Retry interval SSEEventSink used to send stream of messages SSEEvent is base event class, OutboundSseEvent packages an event
  • 19. 19 Jakarta Security Standard Security Provided - Ability to apply across multiple identity stores: Database, LDAP, Embedded - Annotations for ease of development - Remembers caller (cookie, identity store) - Group to Role Mapping - Standard expression language accessors - Simplified HttpAuthenticationMechanism interface with three default implementations: basic, form, LDAP
  • 20. 20 Jakarta Bean Validation Validate field content using simple annotations - Support for more flexible cascaded validation of constraint types - Support for java.util.Optional - Support for @Past and @Future - New annotations: @Email, @NotEmpty, @NotBlank, @Positive, @PositiveOrZero, @Negative, @NegativeOrZero, @PastOrPresent, @FutureOrPresent
  • 21. 21 Jakarta Persistence Updated in latest releases: - Streams - Repeatable Annotations - Date-Time API - CDI Injection in AttributeConverters
  • 22. 22 Jakarta WebSockets Full-Duplex Communication Between Peers - Create a WebSocket endpoint by annotating a POJO with @ServerEndpoint - Create a message receiver method and annotate with @OnMessage - Supports: - @OnOpen - @OnError
  • 24. 24 MicroProfile - Health Health probes for Kubernetes - Liveness vs Readiness probes - liveness probe; restart container when not healthy - readiness probe; when container is ready to receive traffic Example: - Programmatic readiness probe
  • 25. 25 MicroProfile - Config Property injection - This specification is not part of the Jakarta EE (yet) - Spring Framework/Boot does also contain this feature - Can inject properties provided by the app or the environment, like Kubernetes Example: Inject in Jakarta EE JAX-RS endpoint - This is an example of where Jakarta EE and MicroProfile complement each other
  • 26. MicroProfile - RestClient HTTP client specification - JAX-RS and MP RestClient both have programmatic client - MP RestClient can annotate interfaces Example: - Use CDI and MP Config to inject the MP RestClient with an environment-specific URL
  • 27. MicroProfile - FaultTolerance Increase the success rate of your requests by adding resilience to requests Good practice to add: - @Retry how many times will the request be repeated on error - @Timeout how long will the client wait for a response - @Fallback what will the behaviour be when no retries are left
  • 28. MicroProfile - FaultTolerance Increase the success rate of your requests by adding resilience to requests More advanced tuning of resilience: - @CircuitBreaker fail incoming requests when calls to a downstream service are subsequently failing over a defined threshold - @Bulkhead Limit concurrent requests to a downstream service
  • 30. Docker Image Ship your dependencies as part of the infrastructure - Download and ship project's dependency to the Docker Image
  • 31. 31