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

What's Coming in Jakarta EE 11?

Reza Rahman
December 06, 2020

What's Coming in Jakarta EE 11?

Jakarta EE 10 has now been delivered and work on Jakarta progresses. This is a perfect time to begin exploring the horizons of Jakarta EE 11 and how you can help make it reality.

We will guide you on how to begin contributing towards Jakarta EE 11. We will cover ways of contributing, what paperwork is needed as well as the likely possibilities for Jakarta EE 11 including high level themes, platform level changes and some detailed features. Some technologies that might change include Jakarta Security, Concurrency and Messaging. New APIs that could be added include Jakarta NoSQL, RPC, Repositories, and Configuration. We will talk about non-specification projects such as the Starter, Tutorial and Samples.

We will also discuss what might be after Jakarta EE 11. Bring your thinking caps!

Reza Rahman

December 06, 2020

More Decks by Reza Rahman

Other Decks in Programming


  1. What's Coming in Jakarta EE 11? Reza Rahman Jakarta EE

    Ambassador, Author, Blogger, Speaker [email protected] @reza_rahman
  2. Jakarta EE • Java EE transitioned from JCP to Eclipse

    Foundation as Jakarta EE • Open governance, open source, open compatibility testing • Well-defined specification process, clear IP flow, vendor-neutral open collaboration, level playing field • Key stakeholders maintained if not expanded including Oracle, IBM, Red Hat, Payara and VMware • Community participation and contribution key https://jakarta.ee
  3. The Importance of Jakarta EE • Jakarta EE is an

    important part of the Java ecosystem • 25-35% of Java applications run on Jakarta EE application servers • WildFly, Payara, GlassFish, JBoss EAP, WebSphere/Liberty, WebLogic • 70-80% of Java applications depend on at least one or more Jakarta EE APIs • Tomcat, Hibernate, ActiveMQ, Jetty, CXF, Jersey, RESTEasy, Quarkus, MicroProfile, Spring 2023 Jakarta EE Developer Survey: https://outreach.eclipse.foundation/jakarta-ee-developer-survey-2023
  4. Jakarta EE Evolution JPE J2EE 1.2 Servlet, JSP, EJB, JMS

    J2EE 1.3 CMP, JCA J2EE 1.4 JAX-WS Java EE 5 EJB 3, JPA, JSF, JAXB, JAX-WS Java EE 7 WebSocket, JSON, Concurrency, Batch, pruning Java EE 8 HTTP/2, SSE, Security, pruning Java EE 6 Profiles, CDI, JAX- RS, Bean Validation Jakarta EE 8 Open-source governance Jakarta EE 9.x Namespace transition Jakarta EE 10 New features, updates Jakarta EE 11 New APIs, features, updates
  5. • CDI Alignment • @Asynchronous, @Schedule, @Lock, @MaxConcurrency in Concurrency,

    @MessageListener in Messaging, @RolesAllowed, @RunAs in Security • Better CDI support in Batch, REST • Java SE Alignment • CompletionStage in Concurrency • Bootstrap APIs for REST, Messaging • Closing standardization gaps • OpenID Connect, JWT alignment, batch job definition Java API, @ManagedExecutorDefinition, more SQL support, multipart/form-data • Core/Microservices Profile • Deprecation/removal • EJB Entity Beans, embeddable EJB container, deprecated Servlet/Faces/CDI features • Innovation • Repositories, NoSQL, MVC, Configuration, gRPC Jakarta EE 10 in Context Made it! On the way Gap
  6. Jakarta EE 11 Possibilities • CDI Alignment • @Schedule, @Lock,

    @MaxConcurrency in Concurrency, @MessageListener in Messaging, @RolesAllowed, @RunAs in Security • Better CDI support in REST, Persistence • Java SE Alignment • Adapting to Records, Virtual Threads • Bootstrap API for Messaging • Modularity, standalone/modernized TCKs • Closing standardization gaps • JWT alignment, batch job definition Java API, @Service • Deprecation/removal • JAX-WS (SOAP), JAXB (XML), CORBA, @ManagedBean, EJB • Innovation • Repositories, NoSQL, MVC, Configuration, gRPC On the way Gap
  7. • H1 2024 target release date • Java SE 17/21

    baseline, adapting to key changes • Records, Virtual Threads, Security Manager deprecation • Specification updates • Persistence, Concurrency, CDI, Validation • New specifications • Data • Deprecation • JAX-WS (SOAP), JAXB (XML), CORBA, @ManagedBean Jakarta EE 11 Themes
  8. Jakarta Concurrency • Adapting to Virtual Threads • Virtual Threads

    likely mostly implementation level concern for runtimes • CDI based, modernized equivalent for EJB @Schedule, @Lock • Adding @MaxConcurrency
  9. CDI Based @Lock @ApplicationScoped @Lock(READ) public class CountryInfoService { ...

    public List<String> getStates(String country) { return countryStatesMap.get(country); } ... @Lock(WRITE) public void setStates(String country, List<String> states) { countryStatesMap.put(country, states); } }
  10. Jakarta Security • JWT alignment • MicroProfile bridge specification •

    Multiple authentication mechanisms • Authentication mechanism per URL • User choice of authentication mechanism • CDI based, modernized equivalent for @RolesAllowed, @RunAs • EL enabled authorization annotation
  11. EL Enabled Authorization Annotation @Authorized("hasRoles('Manager') && schedule.officeHours") public void transferFunds();

    @Authorized("hasAttribute('directReports', employeeId)") public double getSalary(long employeeId);
  12. Jakarta Persistence • Support for Java SE Records as embeddable

    classes • Deprecate usage of Date, Time, Timestamp, @Temporal in favor of Date/Time API • More SQL-like features in QL and criteria API • concat (||), union, intersect, except, cast, left, right, replace • Support for subqueries • Thread-safe EntityManager via @Inject • Make persistence.xml optional/empty marker • JCache as a second-level cache provider
  13. Embeddable Records @Embeddable public record Address (String street, String city,

    String state, String zipCode) { } @Entity public class Person { @Id private Long id; private String firstName; private String lastName; @Embedded private Address address; ... }
  14. • CDI based, modernized @MessageListener • Jakarta Messaging Lite for

    cloud native use cases • Standalone bootstrap API • AMQP interoperability Jakarta Messaging
  15. @MessageListener Example @ApplicationScoped @MaxConcurrency(10) public class HandlingEventRegistrationAttemptConsumer { @MessageListener( destinationLookup="jms/HandlingEventRegistrationAttemptQueue",

    selector="source = 'mobile'", batchSize=10, orderBy=TIMESTAMP, retry=5, retryDelay=7000, deadLetterQueue="jms/DeadLetterQueue") public void onEventRegistrationAttempt( HandlingEventRegistrationAttempt... attempts) { ... } }
  16. Bootstrap API for Jakarta Messaging JmsContainer container = JmsContainerFactory.newInstance(); ...

    JMSContext jmsContext = container.getJmsContext(); Destination handlingEventQueue = container.getDestination( “jms/HandlingEventRegistrationAttemptQueue” true); ... jmsContext.createProducer() .setDisableMessageID(true) .setDisableMessageTimestamp(true) .setStringProperty("source", source) .send(handlingEventQueue, attempt); ... container.close();
  17. • Higher level (Repository pattern) data access abstraction like DeltaSpike

    Data, Spring Data • Automatically generated Repository implementations based on annotated interface • Both Jakarta Persistence and NoSQL Jakarta Data
  18. Jakarta Data Example @Entity public class Product { @Id private

    long id; @Column @NotBlank private String name; @Column @PositiveOrZero private float price; @Repository public interface Products extends CrudRepository<Product, Long> { @Asynchronous @OrderBy("price") CompletableFuture<List<Product>> findByNameContains(String searchFor); @Query( "UPDATE Product o SET o.price = o.price - (?2 * o.price) WHERE o.id = ?1") boolean discount(long productId, float discountRate); }
  19. • Standard action-based web framework • Jakarta Faces continues to

    evolve separately • “Prospective specification” in Jakarta EE 11 • Model • CDI, Bean Validation • View • Facelets, Jakarta Server Pages • Controller • Majority of work here • Based on Jakarta REST Jakarta MVC
  20. Jakarta MVC Example @Controller @Path("/") @View("my-index.xhtml") public class Bookstore {

    @Inject private Models model; @Inject private BookService service; ... @GET public void index() { ... model.put(“books”, books); } }
  21. • Specification for accessing NoSQL databases • Mapping/template API akin

    to JPA • API variants by NoSQL taxonomy • Key-value pair, column family, document and graph • Repositories, validation, externalized configuration Jakarta NoSQL
  22. Jakarta NoSQL Example @Entity public class Order { @Id private

    long id; @Column @NotBlank private String description; @Column @NotEmpty private List<OrderLine> orderLines; @Column @NotNull private Customer customer; @Column @NotNull private Address address; template.insert(order); ... List<Order> results = template.select(Order.class) .where("description").like("^Pinball").result(); logger.info("Found orders for pinball: " + results.size());
  23. Configuration • Externalizing application configuration • Built-in stores • Property

    files, Java system properties, environment variables • Extensible stores • Kubernetes secrets • Secure cloud storage (such as Azure Key Vault) • NoSQL stores (such as Azure Redis) • Relational database • @Inject into code • Reference in EL • Reference in XML • Moving MicroProfile Config to Jakarta EE
  24. Configuration Examples @Inject @ConfigProperty(name = “admin.group”, defaultValue=“admin”) private String adminGroup;

    persistence.provider=org.hibernate.ejb.HibernatePersistence persistence.datasource=java:app/jdbc/CargoTrackerDatabase persistence.schema.generation.database.action=create <data-source> <name>java:app/jdbc/CargoTrackerDatabase</name> <class-name>org.apache.derby.jdbc.EmbeddedDriver</class-name> <url>jdbc:derby:${temp.dir}/cargo-tracker-database</url> </data-source>
  25. Other Changes • Java SE Records support in Jakarta Validation,

    CDI, EL • @ManagedBean deprecated • Java SE SecurityManager dependency removed • Jakarta REST @Context replaced by CDI/@Inject • @Context deprecated • Java job definition API as alternative to XML in Jakarta Batch • @Priority on producers
  26. Validating Records public record Car( @NotBlank String manufacturer, @NotNull @Size(min

    = 2, max = 14) String licensePlate, @Min(2) int seatCount) { }
  27. Job Definition API Example Job job = new JobBuilder(jobName).property("jobk1", "J")

    .listener("jobListener1", new String[]{"jobListenerk1", "#{jobParameters['jobListenerPropVal']}"}, .step(new StepBuilder(stepName) .properties(new String[]{"stepk1", "S"}, new String[]{"stepk2", "S"}) .batchlet(batchlet1Name, new String[]{"batchletk1", "B"}, new String[]{"batchletk2", "B"}) .listener("stepListener1", stepListenerProps) .stopOn("STOP").restartFrom(stepName).exitStatus() .endOn("END").exitStatus("new status for end") .failOn("FAIL").exitStatus() .nextOn("*").to(step2Name) .build()) ... .build();
  28. • More custom websites for key Jakarta EE technologies •

    Like https://beanvalidation.org, http://www.cdi-spec.org • Jakarta Starter • Helping developers getting started quickly • Jakarta EE Tutorial • The official free resource to learn Jakarta EE • Jakarta EE Examples • Quickly getting working code for most use cases • Eclipse Cargo Tracker • End-to-end application demonstrating architectural practices like Domain-Driven Design Beyond Specification Work
  29. Ways of Contributing • Follow Jakarta EE technologies that interest

    you and share opinion • https://jakarta.ee/connect/mailing-lists/ • Advocate for a specific change or feature • https://jakarta.ee/projects/ • Help implement a change in API, specification, TCK or implementation • Sign Eclipse Contributor Agreement • https://www.eclipse.org/legal/ECA.php • Becoming a committer comes much later • Engage an Ambassador if needed • https://jakartaee-ambassadors.io
  30. Summary • One of the key motivations to move Java

    EE to Jakarta EE is greater community contribution • Jakarta EE 11 work is ongoing - time to get involved is now!
  31. Resources • JakartaOne Livestream recordings • https://jakartaone.org • Jakarta EE

    Community alias • https://accounts.eclipse.org/mailing-list/jakarta.ee-community • Jakarta EE Twitter handle • @JakartaEE • Jakarta Tech Talks • https://www.meetup.com/jakartatechtalks_