Slide 1

Slide 1 text

What’s new with Jakarta EE 10 And MicroPro fi le 6.1 And why you should matter?

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

We are Hiring! https://bit.ly/sciam-jobs

Slide 5

Slide 5 text

Agenda About Jakarta EE 10 Introduction and history What’s new in EE 10 About Micropro fi le 6.1 Introduction and history Conclusion

Slide 6

Slide 6 text

Eclipse Jakarta EE 10

Slide 7

Slide 7 text

- 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 »

Slide 8

Slide 8 text

What is Jakarta EE? Speci fi cations Documentation Speci fi cations Code & API Speci fi cations TCK

Slide 9

Slide 9 text

J2EE, Java EE, Jakarta EE Timeline Initial work on Oak started in 1991. It became Green then Java, 1996: Java First public implementation.

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

J2EE, Java EE, Jakarta EE Timeline 1999 J2EE 1.2 2001 J2EE 1.3

Slide 12

Slide 12 text

J2EE, Java EE, Jakarta EE Timeline 1999 J2EE 1.2 2001 J2EE 1.3 2003 J2EE 1.4

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

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

Slide 16

Slide 16 text

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)

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

Jakarta EE 10 in a (big) nutshell

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

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

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

OpenID Connect Authentication Mechanism @OpenIdAuthenticationMechanismDefinition( providerURI = "http://oidc-provider", clientId = "client", clientSecret = "secret", redirectURI = "${baseURL}/Callback", redirectToOriginalResource = true )

Slide 28

Slide 28 text

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

Slide 29

Slide 29 text

UUID as Basic Java Type @Entity public class Item { @Id @GeneratedValue(strategy=GenerationType.UUID) private java.util.UUID id; private String description; … }

Slide 30

Slide 30 text

Java SE Bootstrap API public static void main(String[] args) { Application app = new MyApplication(); SeBootstrap.start(app); }

Slide 31

Slide 31 text

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

Slide 32

Slide 32 text

Multipart/form-data Support @GET @Produces(MediaType.MULTIPART_FORM_DATA) List getFiles(…) { List parts = new ArrayList<>(); … for(File f: dir.listFiles()) { parts.add(EntityPart.withFileName(f.getName) .content(new FileInputStream) .mediaType(“application/pdf”) .build(); } return parts; }

Slide 33

Slide 33 text

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

Slide 34

Slide 34 text

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

Slide 35

Slide 35 text

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

Slide 36

Slide 36 text

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

Slide 37

Slide 37 text

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); } }

Slide 38

Slide 38 text

Build compatible extension example (synthesis) 1/2 // 2. bean creation function public class MyPojoCreator implements SyntheticBeanCreator { @Override public MyPojo create(Instance 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 { @Override public void dispose(MyPojo instance, Instance lookup, Parameters params) { System.out.println("disposing " + instance.data); } }

Slide 39

Slide 39 text

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); }

Slide 40

Slide 40 text

Jakarta EE Implementations

Slide 41

Slide 41 text

Spring Is the worst Jakarta EE « implementation »!

Slide 42

Slide 42 text

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

Slide 43

Slide 43 text

MicroPro fi le 6.1

Slide 44

Slide 44 text

-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. »

Slide 45

Slide 45 text

MicroPro fi le Timeline MicroPro fi by Red Hat, IBM, Payara Tomitribe and the London Java Community Group

Slide 46

Slide 46 text

MicroPro fi le Timeline 2016 MP 1.0 Version 1.0 released during Java One on September 19th 2016

Slide 47

Slide 47 text

MicroPro fi le Timeline 2017 MP 1.1 2016 MP 1.0 Version 1.1 : MicroPro fi

Slide 48

Slide 48 text

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

Slide 49

Slide 49 text

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

Slide 50

Slide 50 text

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)

Slide 51

Slide 51 text

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

Slide 52

Slide 52 text

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

Slide 53

Slide 53 text

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

Slide 54

Slide 54 text

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

Slide 55

Slide 55 text

Fault Tolerance Spec example 1

Slide 56

Slide 56 text

Fault Tolerance Doc An easy-to-use and fl exible system for building resilient applications

Slide 57

Slide 57 text

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

Slide 58

Slide 58 text

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

Slide 59

Slide 59 text

Health Check Spec example 2

Slide 60

Slide 60 text

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

Slide 61

Slide 61 text

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

Slide 62

Slide 62 text

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?

Slide 63

Slide 63 text

Micropro fi le 6.0 contributors

Slide 64

Slide 64 text

Micropro fi le implementations

Slide 65

Slide 65 text

Conclusion

Slide 66

Slide 66 text

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

Slide 67

Slide 67 text

Thank You