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

What's new in Jakarta EE 10 and MicroProfile 6.1

What's new in Jakarta EE 10 and MicroProfile 6.1

This talk is a general Jakarta EE (aka Java EE or J2EE) and MicroProfile presentation. It also list some of the new features that came with latest version (in 2024) of Jakarta EE 10 and MicroProfile 6.1.

Antoine Sabot-Durand

January 25, 2024
Tweet

More Decks by Antoine Sabot-Durand

Other Decks in Programming

Transcript

  1. Antoine Sabot-Durand Java Champion Tech Lead at SCIAM Former CDI

    spec lead Former Micropro fi le Health & Fault Tolerance spec lead Follow me: @antoine_sd
  2. SCIAM / IT Consulting & More Based in France :

    Paris, Toulon Only strategic missions (Driven by challenge) Expert from everywhere: France, Iran, Tunisia Morocco, Algeria, Lebanon, Mauritius… More : Behavioral science Collective intelligence
  3. Agenda About Jakarta EE 10 Introduction and history What’s new

    in EE 10 About Micropro fi le 6.1 Introduction and history Conclusion
  4. - Jakarta EE website « Jakarta EE is a set

    of vendor’s neutral, open speci fi cations that are used for developing modern, cloud compatible applications from the ground »
  5. What is Jakarta EE? Speci fi cations Documentation Speci fi

    cations Code & API Speci fi cations TCK
  6. J2EE, Java EE, Jakarta EE Timeline Initial work on Oak

    started in 1991. It became Green then Java, 1996: Java First public implementation.
  7. J2EE, Java EE, Jakarta EE Timeline 1999 J2EE 1.2 Java

    2 Platform Enterprise Edition (J2EE) 1.2 is out ! This 1st version contains 10 speci fi
  8. J2EE, Java EE, Jakarta EE Timeline 1999 J2EE 1.2 2001

    J2EE 1.3 2003 J2EE 1.4 2006 Java EE 5 Java EE 5 introduces EJB 3.0 making heavy use of annotations and AOP
  9. J2EE, Java EE, Jakarta EE Timeline 1999 J2EE 1.2 2001

    J2EE 1.3 2003 J2EE 1.4 2006 Java EE 5 2009 Java EE 6 Java EE 6 introduces CDI 1.0, JPA 2.0 and JAX-RS 1.1 and Web Pro fi
  10. J2EE, Java EE, Jakarta EE Timeline 1999 J2EE 1.2 2001

    J2EE 1.3 2003 J2EE 1.4 2006 Java EE 5 2009 Java EE 6 2013 Java EE 7
  11. J2EE, Java EE, Jakarta EE Timeline 1999 J2EE 1.2 2001

    J2EE 1.3 2003 J2EE 1.4 2006 Java EE 5 2009 Java EE 6 2013 Java EE 7 2017 Java EE 8 Java EE 8 introduces CDI 2.0 => Jakarta EE 8 (move to Eclipse in 2018)
  12. J2EE, Java EE, Jakarta EE Timeline 1999 J2EE 1.2 2001

    J2EE 1.3 2003 J2EE 1.4 2006 Java EE 5 2009 Java EE 6 2013 Java EE 7 2017 Java EE 8 2019 Jakarta EE 8 Jakarta EE 8 is just migration to Jakarta packages Eclipse version of Java EE 8
  13. J2EE, Java EE, Jakarta EE Timeline 1999 J2EE 1.2 2001

    J2EE 1.3 2003 J2EE 1.4 2006 Java EE 5 2009 Java EE 6 2013 Java EE 7 2017 Java EE 8 2019 Jakarta EE 8 2020 Jakarta EE 9 Jakarta EE 9 fi
  14. J2EE, Java EE, Jakarta EE Timeline 1999 J2EE 1.2 2001

    J2EE 1.3 2003 J2EE 1.4 2006 Java EE 5 2009 Java EE 6 2013 Java EE 7 2017 Java EE 8 2019 Jakarta EE 8 2022 Jakarta EE 10 2020 Jakarta EE 9
  15. Jakarta EE 10 in a (big) nutshell Authorization 2.1 Activation

    2.1 Batch 2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 3.1 JSON Processing 2.1 JSON Binding 3.0 Annotations 2.1 CDI Lite 4.0 Interceptors 2.1 Dependency Injection 2.0 Servlet 6.0 Server Pages 3.1 Expression Language 5.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.0 WebSocket 2.1 Enterprise Beans Lite 4.0 Persistence 3.1 Transactions 2.0 Managed Beans 2.0 CDI 4.0 Authentication 3.0 Concurrency 3.0 Security 3.0 Bean Validation 3.0 New Not Updated Updated
  16. Jakarta EE 10 Web Pro fi le Authorization 2.1 Activation

    2.1 Batch 2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 3.1 JSON Processing 2.1 JSON Binding 3.0 Annotations 2.1 CDI Lite 4.0 Interceptors 2.1 Dependency Injection 2.0 Servlet 6.0 Server Pages 3.1 Expression Language 5.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.0 WebSocket 2.1 Enterprise Beans Lite 4.0 Persistence 3.1 Transactions 2.0 Managed Beans 2.0 CDI 4.0 Authentication 3.0 Concurrency 3.0 Security 3.0 Bean Validation 3.0 New Not Updated Updated
  17. Jakarta EE 10 Core Pro fi le Authorization 2.1 Activation

    2.1 Batch 2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 3.1 JSON Processing 2.1 JSON Binding 3.0 Annotations 2.1 CDI Lite 4.0 Interceptors 2.1 Dependency Injection 2.0 Servlet 6.0 Server Pages 3.1 Expression Language 5.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.0 WebSocket 2.1 Enterprise Beans Lite 4.0 Persistence 3.1 Transactions 2.0 Managed Beans 2.0 CDI 4.0 Authentication 3.0 Concurrency 3.0 Security 3.0 Bean Validation 3.0 New Not Updated Updated
  18. What’s new in Jakarta Security Authorization 2.1 Activation 2.1 Batch

    2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 3.1 JSON Processing 2.1 JSON Binding 3.0 Annotations 2.1 CDI Lite 4.0 Interceptors 2.1 Dependency Injection 2.0 Servlet 6.0 Server Pages 3.1 Expression Language 5.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.0 WebSocket 2.1 Enterprise Beans Lite 4.0 Persistence 3.1 Transactions 2.0 Managed Beans 2.0 CDI 4.0 Authentication 3.0 Concurrency 3.0 Security 3.0 Bean Validation 3.0 New Not Updated Updated
  19. What’s new in Jakarta Security OpenID Connect Updates to Lower

    Level SPIs Jakarta Authorization Jakarta Authentication Foundation for Future Work
  20. What’s new in Jakarta Security OpenID Connect Updates to Lower

    Level SPIs Jakarta Authorization Jakarta Authentication Foundation for Future Work
  21. OpenID Connect Authentication Mechanism @OpenIdAuthenticationMechanismDefinition( providerURI = "http://oidc-provider", clientId =

    "client", clientSecret = "secret", redirectURI = "${baseURL}/Callback", redirectToOriginalResource = true )
  22. What’s new in Jakarta Persistence Authorization 2.1 Activation 2.1 Batch

    2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 3.1 JSON Processing 2.1 JSON Binding 3.0 Annotations 2.1 CDI Lite 4.0 Interceptors 2.1 Dependency Injection 2.0 Servlet 6.0 Server Pages 3.1 Expression Language 5.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.0 WebSocket 2.1 Enterprise Beans Lite 4.0 Persistence 3.1 Transactions 2.0 Managed Beans 2.0 CDI 4.0 Authentication 3.0 Concurrency 3.0 Security 3.0 Bean Validation 3.0 New Not Updated Updated
  23. UUID as Basic Java Type @Entity public class Item {

    @Id @GeneratedValue(strategy=GenerationType.UUID) private java.util.UUID id; private String description; … }
  24. Java SE Bootstrap API public static void main(String[] args) {

    Application app = new MyApplication(); SeBootstrap.start(app); }
  25. What’s new in Jakarta RESTful WS Authorization 2.1 Activation 2.1

    Batch 2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 3.1 JSON Processing 2.1 JSON Binding 3.0 Annotations 2.1 CDI Lite 4.0 Interceptors 2.1 Dependency Injection 2.0 Servlet 6.0 Server Pages 3.1 Expression Language 5.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.0 WebSocket 2.1 Enterprise Beans Lite 4.0 Persistence 3.1 Transactions 2.0 Managed Beans 2.0 CDI 4.0 Authentication 3.0 Concurrency 3.0 Security 3.0 Bean Validation 3.0 New Not Updated Updated
  26. Multipart/form-data Support @GET @Produces(MediaType.MULTIPART_FORM_DATA) List<EntityPart> getFiles(…) { List<EntityPart> parts =

    new ArrayList<>(); … for(File f: dir.listFiles()) { parts.add(EntityPart.withFileName(f.getName) .content(new FileInputStream) .mediaType(“application/pdf”) .build(); } return parts; }
  27. What’s new with CDI lite Authorization 2.1 Activation 2.1 Batch

    2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 3.1 JSON Processing 2.1 JSON Binding 3.0 Annotations 2.1 CDI Lite 4.0 Interceptors 2.1 Dependency Injection 2.0 Servlet 6.0 Server Pages 3.1 Expression Language 5.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.0 WebSocket 2.1 Enterprise Beans Lite 4.0 Persistence 3.1 Transactions 2.0 Managed Beans 2.0 CDI 4.0 Authentication 3.0 Concurrency 3.0 Security 3.0 Bean Validation 3.0 New Not Updated Updated
  28. What is CDI Lite? Providing a lighter CDI footprint (CPU,

    memory, runtime size) Constrained environment Cloud environnement Main goal : providing a CDI subset able to provide the CDI magic at build time First candidates for this Lite approach Quarkus Micronaut Helidon
  29. What’s not in CDI Lite Decorators (could be done, but

    the effort is bigger than the usage) @Session and @Conversation scopes Specialization than requires a lot of re fl ection Beans Passivation The standard Portable extension but we provided a new build time compatible extension! Good news: as full is a lite super set, features could be moved to Lite later
  30. Build time compatible extension Most of the feature provided by

    portable extension are also available in build time compatible CDI Full support build time compatible extension You can’t use both in your dev As these extension are activated at build time, a new metadata API was introduced to replace what is done by re fl ection in full
  31. Build compatible extension example (enhancement) public class MyExtension implements BuildCompatibleExtension

    { @Enhancement(types = MyFooService.class) public void foo(ClassConfig clazz) { clazz.removeAnnotation(it -> it.name().equals(MyQualifier.class.getName())); } @Enhancement(types = MyBarService.class) public void bar(ClassConfig clazz) { clazz.addAnnotation(MyQualifier.class); } }
  32. Build compatible extension example (synthesis) 1/2 // 2. bean creation

    function public class MyPojoCreator implements SyntheticBeanCreator<MyPojo> { @Override public MyPojo create(Instance<Object> lookup, Parameters params) { String name = params.get("name", String.class); return new MyPojo("Hello " + name); } } // 3. bean disposal function public static class MyPojoDisposer implements SyntheticBeanDisposer<MyPojo> { @Override public void dispose(MyPojo instance, Instance<Object> lookup, Parameters params) { System.out.println("disposing " + instance.data); } }
  33. Build compatible extension example (synthesis) 2/2 // 3. Extension public

    static class MyExtension implements BuildCompatibleExtension { @Synthesis public void synthesise(SyntheticComponents syn) { syn.addBean(MyPojo.class) .type(MyPojo.class) .withParam("name", "World") .createWith(MyPojoCreator.class) .disposeWith(MyPojoDisposer.class); }
  34. Jakarta EE 10 specs used in Spring Authorization 2.1 Activation

    2.1 Batch 2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 3.1 JSON Processing 2.1 JSON Binding 3.0 Annotations 2.1 CDI Lite 4.0 Interceptors 2.1 Dependency Injection 2.0 Servlet 6.0 Server Pages 3.1 Expression Language 5.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.0 WebSocket 2.1 Enterprise Beans Lite 4.0 Persistence 3.1 Transactions 2.0 Managed Beans 2.0 CDI 4.0 Authentication 3.0 Concurrency 3.0 Security 3.0 Bean Validation 3.0
  35. -Micropro fi le Website « An open speci fi cations

    stack to optimize Enterprise Java for a microservices architecture by collaborating on common areas of interest with a goal of standardization. »
  36. MicroPro fi le Timeline MicroPro fi by Red Hat, IBM,

    Payara Tomitribe and the London Java Community Group
  37. MicroPro fi le Timeline 2016 MP 1.0 Version 1.0 released

    during Java One on September 19th 2016
  38. MicroPro fi le Timeline 2018 MP 2.0 2017 MP 1.1

    2016 MP 1.0 Version 2.0 : upgrade to Java EE 8 Fault Tolerance, Health Check, JWT, Metrics, OpenAPI, OpenTracing, Rest Client
  39. MicroPro fi le Timeline 2018 MP 2.0 2019 MP 3.0

    2017 MP 1.1 2016 MP 1.0 Version 3.0 :Programming model enhancement
  40. MicroPro fi le Timeline 2018 MP 2.0 2019 MP 3.0

    2020 MP 4.0 2017 MP 1.1 2016 MP 1.0 Version 4.0 : Introducing standalone specs (Reactive messaging, reactive streams operators, context propagation, GraphQL)
  41. MicroPro fi le Timeline 2018 MP 2.0 2019 MP 3.0

    2020 MP 4.0 2021 MP 5.0 2017 MP 1.1 2016 MP 1.0 Version 5.0 : Long Running Action
  42. MicroPro fi le Timeline 2018 MP 2.0 2019 MP 3.0

    2020 MP 4.0 2021 MP 5.0 2022 MP 6.0 2017 MP 1.1 2016 MP 1.0 Version 6.0 : Jakarta EE 10 Core Pro fi
  43. MicroPro fi le Timeline 2018 MP 2.0 2019 MP 3.0

    2020 MP 4.0 2021 MP 5.0 2022 MP 6.0 2017 MP 1.1 2016 MP 1.0 2023 MP 6.1
  44. Micropro fi le 6.1 Telemetry 1.1 Fault Tolerance 4.0 Con

    fi g 3.0 Health 4.0 Jakarta EE 10 Core Pro fi le Rest Client 3.0 JWT Auth. 2.1 Metrics 5.1 Open API 3.1 New Not Updated Updated Open Tracing 3.0 LRA 2.0 GraphQL 2.0 Context Propagation 1.3 Reactive messaging 3.0 Reactive Streams Operators 3.0 Micropro fi le 6.1 Standalone Outside umbrella
  45. Fault Tolerance annotations 1/2 @Asynchronous: to transform a standard method

    in an asynchronous task. You can control the outcome by having the method returning a Futur @Timeout: to de fi ne a timeout duration on a given task (can be used on a method in the local thread or on an @Asynchronous task). @Retry: To retry an unsuccessful treatment a given number of time
  46. Fault Tolerance annotations 2/2 @Fallback: launch an alternative process if

    the annotated method fails with a given exceptions set @CircuitBreaker: Implementation of the Circuit Breaker pattern (stop calling an unresponsive service, and strategy to reopen the circuit under the hood) @BulkHead: Limit the number a thread using given method and optionally de fi ne a writing queue
  47. MP Health Spec MicroPro fi le Health speci fi cation

    de fi nes a single container runtime mechanism for validating the availability and status of a service
  48. Health Interfaces, classes and format HeatlthCheck: an interface to provide

    a contract for creating a speci fi c HealthCheck HealthCheckReponse: a builder class used to create response for a check A JSon format sepc for the response A list of rules regarding url used for Rest HealthCheck
  49. Three Flavor of check @Liveness: is the service alive? @Startup:

    is the service already started (may not be ready)? @Readiness: is the service ready to serve request?
  50. One of the biggest playground for enterprise Java Contribute to

    specs Jakarta EE and Micropro fi le community are very open : • https://jakarta.ee/ or https://micropro fi le.io/ Contribute to implementations Multiple places like https://smallrye.io/ Develop your home-brew stuff