Share
Embed
Building Microservices with Jakarta EE and MicroProfile - EclipseCon 2019
Edwin Derks
October 22, 2019
Transcript
31 slides
-
Edwin Derks Java (EE) Developer Software Architect Conference Speaker @edwinderks
cloudnativesolutions.guru -
Tutorial Session Prerequisites This URL redirects to the Github page
containing the tutorial assignments: http://ivo2u.nl/oA Follow these instructions to setup your device for the tutorial: http://ivo2u.nl/oc -
Photo by Inge Wallumrød from Pexels This tutorial will focus
on: - Vendors and Portability - Various Runtimes - Efficient development -
Photo by David Dibert from Pexels - Ship with Docker
- Running in a cloud-native environment -
Evolution of Java EE and Spring 1990’s now() ? CLOUD
Virtualize Hardware -
Feature-rich platform of API’s for building enterprise applications Jakarta EE
in a nutshell... - Profiles - Full - Web - Enterprise Development APIs - JSP - JSF - EJB - CDI - JAX-RS - JPA - ...many others -
Designed for building and running scalable applications Microprofile in a
nutshell... - Java EE / Jakarta EE 8 base (CDI, JSON-P, JAX-RS) - Microservice APIs - Healthcheck - Fault Tolerance - Metrics - Config - Tracing - Rest Client - JWT - …others -
Photo by Miguel Á. Padriñán from Pexels Uber / Fat
JAR Application Server Hollow JAR + -
Examples of Application Server Vendors Community Edition & Production Supported
Community Edition Community Edition Production Supported -
Jakarta EE & MicroProfile compliant Application Server WAR / EAR
Java • Runs with Java version supported by the server Conventional application server runtime <dependency> <groupId>jakarta.platform</groupId> <artifactId>jakarta.jakartaee-api</artifactId> <version>8.0.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.eclipse.microprofile</groupId> <artifactId>microprofile</artifactId> <version>2.2</version> <type>pom</type> </dependency> • One complete package providing Jakarta EE • What you see is what you get • Thoroughly tested by vendor • Easily patched and upgraded • Enables portability for enterprise applications -
Application server runtime provided as Hollow JAR Java • Runs
with Java version supported by the server JAR WAR • Applications server as one single artifact • Little to no operational management tools • Don’t include the whole application server with every build of your application • “Just enough app server” -
Application server runtime provided as Uber JAR Java • Runs
with Java version supported by the server JAR Compiled Java Bytecode • One single artifact • Little to no operational management tools • Contains your code and application server • Opposite of lean and tidy, so bigger in size • “Just enough app server” -
JDK 8+ Platform Choose the fitting Java version for your
application server runtime JVM JAR WAR EAR COMPILES RUNS IMPLEMENT Runtime 8 5.193 2.2 HOTSPOT DEPLOYS -
Photo by David Dibert from Pexels But in the end
Docker … does it even matter? -
Shipping and deploying with Docker Docker Image Choose your runtime
Java JAR / WAR / EAR Operational Environment • Use docker-compose • Ship anywhere • Run anywhere Docker Image Choose your runtime Java JAR / WAR / EAR -
WAR / EAR Java 11 Java 8 JAR W A
R Java 11 JAR Compiled Java Docker Image Payara Server Java 11 WAR Docker Image Payara Micro Java 8 WAR Docker Image Java 11 Uber JAR application-server-project uber-jar-project Quotes - JAX-RS - MicroProfile RestClient - MicroProfile FaultTolerance: - Retry, Fallback, Timeout - JSF + PrimeFaces - CDI - MicroProfile RestClient - JAX-RS - CDI - JPA - JSON-B hollow-jar-project -
Docker Image Payara Server Java 11 WAR Docker Image Payara
Micro Java 8 WAR Docker Image Java 11 Uber JAR - JAX-RS - MicroProfile RestClient - MicroProfile FaultTolerance: - Retry, Fallback, Timeout - JSF + PrimeFaces - CDI - MicroProfile RestClient - JAX-RS - CDI - JPA - JSON-B - health Quotes -
Tutorial Session Prerequisites This URL redirects to the Github page
containing the tutorial assignments: http://ivo2u.nl/oA Follow these instructions to setup your device for the tutorial: http://ivo2u.nl/oc ...but let’s have a short break first! -
Tutorial Bonus Assignments Further exploration of possibilities Jakarta EE -
Play around with flaky behaviour - Modify/Add Quotes - Explore JSF - https://www.primefaces.org/showcase/ - Add Exception handling - Choose different component for displaying Quotes MicroProfile MicroProfile Fault Tolerance: • Use @CircuitBreaker in hollow-jar-project MicroProfile Metrics: • Add @Counted • Add @Metered MicroProfile Health: • Create a custom HealthCheck Tips: https://start.microprofile.io -
Thank you for your visiting this tutorial We value your
feedback @edwinderks cloudnativesolutions.guru @ivonet ivonet.nl @tozkeles [email protected]