Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building Microservices with Jakarta EE and Micr...

Building Microservices with Jakarta EE and MicroProfile - EclipseCon 2019

Edwin Derks

October 22, 2019

Transcript

31 slides
  1. 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
  2. Photo by Inge Wallumrød from Pexels This tutorial will focus

    on: - Vendors and Portability - Various Runtimes - Efficient development
  3. Photo by David Dibert from Pexels - Ship with Docker

    - Running in a cloud-native environment
  4. 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
  5. 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
  6. Photo by Miguel Á. Padriñán from Pexels Uber / Fat

    JAR Application Server Hollow JAR +
  7. Examples of Application Server Vendors Community Edition & Production Supported

    Community Edition Community Edition Production Supported
  8. 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
  9. 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”
  10. 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”
  11. 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
  12. Photo by David Dibert from Pexels But in the end

    Docker … does it even matter?
  13. 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
  14. 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
  15. 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
  16. 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!
  17. 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
  18. Thank you for your visiting this tutorial We value your

    feedback @edwinderks cloudnativesolutions.guru @ivonet ivonet.nl @tozkeles [email protected]

More Decks by Edwin Derks

Other Decks in Programming