│©2023 VMware, Inc.
Spring Boot 3 & Beyond
Dan Vega
Spring Developer Advocate
● Husband & Father
● Cleveland
● Software Developer 22+ Years
● Spring Developer Advocate
● Content Creator (www.danvega.dev)
○ Blogger
○ YouTuber
○ Course Creator
● @therealdanvega
About Dan Vega
● JDK 17+
● Jakarta EE 9 / 10 (jakarta namespace)
● AOT (Ahead-Of-Time)
● Virtual Threads (“Project Loom”)
● Observability (Micrometer)
● But wait, there's more!
● Spring Boot 3.1+
● Spring Boot 3 Demo
A new generation of Spring for 2023 and beyond
Java and Jakarta
Baseline: JDK 17 LTS
Language: text blocks, switch expressions
Core libraries: collection factory methods, etc
Type system: records, sealed classes
Module system: module introspection, module path scanning
Performance Improvements
Security Updates
Empowering the framework as well as applications
JDK 17 / 20 / 21
Spring generally embraces the latest JDK/JVM versions
JDK 17 baseline retained for long-term support purposes
E.g. in JDK 20: virtual threads, record patterns (preview)
JDK 21 on the horizon as next long-term support release
Consider upgrading your JDK along with Spring Framework 6.x
Baseline: Jakarta EE 9
A new namespace: Java EE 8 → Jakarta EE 9
Servlet API 5.0 : javax.servlet → jakarta.servlet
JPA 3.0 : javax.persistence → jakarta.persistence
Bean Validation 3.0 : javax.validation → jakarta.validation
Dependency Injection 2.0 : javax.inject → jakarta.inject
All further API evolution to happen in jakarta namespace
Jakarta EE 9 / 10
Tomcat 10.0 / 10.1 – Servlet API 5.0 / 6.0
Jetty 11 / 12 – Servlet API 5.0 / 6.0
Undertow 2.3 – Servlet API 6.0
Hibernate ORM 6.1 – JPA 3.0 / 3.1
Hibernate Validator 7.0 / 8.0 – Bean Validation 3.0
Note: API upgrades not coupled to major provider versions anymore!
Jakarta EE 10 preferred
Spring Framework 6.0 auto-detects EE 10 APIs at runtime
E.g. using EE 10’s WebSocket protocol upgrade API
Spring Boot 3.0 effectively ships EE 10 APIs and providers
One exception: Jetty 11, since Jetty 12 is not final yet
Note: Spring’s Servlet mocks are Servlet 6.0 (EE 10) based
Ahead-Of-Time
Spring AOT
Reducing startup time and memory footprint in production
Runtime hints for reflection, resources, serialization, proxies
Optional for optimized JVM deployments
Precondition for GraalVM native executables
AOT is a tradeoff: extra build setup and less flexibility at runtime
GraalVM Native Image
GraalVM as the de-facto standard for native executables
Strong closed-world assumption, no runtime adaptations
AOT-processed application as input → native executable
Very long build time for actual native code generation
A different mode of deployment with strong benefits and limitations
Virtual Threads
Virtual Threads versus Reactive Programming
Virtual threads provide a different scalability mechanism
Traditional imperative programming style, revisited
Empowering Spring MVC to reach a new level of scalability
Spring WebFlux as an architecture for stream-based processing
Reactive: stream-based style, not primarily for scalability (anymore)
Embracing Virtual Threads
Higher scalability needed for Servlet deployments
Or same concurrency but with a smaller footprint
Best possible use of available CPU resources
Virtual threads supported in GraalVM Native Image as well
High expectations in the community
Observability
Observability
Observability is the ability to observe the internal state of a running system from
the outside. It consists of the three pillars logging, metrics and traces.
Direct Observability instrumentation with Micrometer Observation in several parts
of the Spring Framework.
RestTemplate and WebClient are instrumented to produce HTTP client request
observations.
Spring Cloud Sleuth no longer needed for Distributed Tracing
Observation API
But wait, there’s more!
Spring Boot 3
HTTP Interface Client
RFC 7807 Problem Details
Spring Data 2022
Spring Security 6
Spring Authorization Server 1.0
Spring for GraphQL 1.1
More
Spring Boot 3.1
Spring Boot 3.1.0 RC 1
Using Testcontainers at Development Time
Docker Compose spring-boot-docker-compose module
Building Docker Images with Maven or Gradle
Dependency Upgrades
https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.1.0-RC1-Release-Notes
DEMO
Spring Framework 6.0 – available now
Foundation for Spring Boot 3.0 & 3.1
Production-ready on JDK 17 LTS
Regular stream of 6.0.x releases in 2023
Spring Framework 6.1 – November 2023
Foundation for Spring Boot 3.2 & 3.3
Production-ready on JDK 17 & 21 LTS
Release candidate expected in September 2023
Thank you 🙏
Dan Vega
Spring Developer Advocate
dvega@vmware.com

SpringOne Tour: Spring Boot 3 and Beyond

  • 1.
    │©2023 VMware, Inc. SpringBoot 3 & Beyond Dan Vega Spring Developer Advocate
  • 2.
    ● Husband &Father ● Cleveland ● Software Developer 22+ Years ● Spring Developer Advocate ● Content Creator (www.danvega.dev) ○ Blogger ○ YouTuber ○ Course Creator ● @therealdanvega About Dan Vega
  • 4.
    ● JDK 17+ ●Jakarta EE 9 / 10 (jakarta namespace) ● AOT (Ahead-Of-Time) ● Virtual Threads (“Project Loom”) ● Observability (Micrometer) ● But wait, there's more! ● Spring Boot 3.1+ ● Spring Boot 3 Demo A new generation of Spring for 2023 and beyond
  • 5.
  • 7.
    Baseline: JDK 17LTS Language: text blocks, switch expressions Core libraries: collection factory methods, etc Type system: records, sealed classes Module system: module introspection, module path scanning Performance Improvements Security Updates Empowering the framework as well as applications
  • 8.
    JDK 17 /20 / 21 Spring generally embraces the latest JDK/JVM versions JDK 17 baseline retained for long-term support purposes E.g. in JDK 20: virtual threads, record patterns (preview) JDK 21 on the horizon as next long-term support release Consider upgrading your JDK along with Spring Framework 6.x
  • 9.
    Baseline: Jakarta EE9 A new namespace: Java EE 8 → Jakarta EE 9 Servlet API 5.0 : javax.servlet → jakarta.servlet JPA 3.0 : javax.persistence → jakarta.persistence Bean Validation 3.0 : javax.validation → jakarta.validation Dependency Injection 2.0 : javax.inject → jakarta.inject All further API evolution to happen in jakarta namespace
  • 11.
    Jakarta EE 9/ 10 Tomcat 10.0 / 10.1 – Servlet API 5.0 / 6.0 Jetty 11 / 12 – Servlet API 5.0 / 6.0 Undertow 2.3 – Servlet API 6.0 Hibernate ORM 6.1 – JPA 3.0 / 3.1 Hibernate Validator 7.0 / 8.0 – Bean Validation 3.0 Note: API upgrades not coupled to major provider versions anymore!
  • 12.
    Jakarta EE 10preferred Spring Framework 6.0 auto-detects EE 10 APIs at runtime E.g. using EE 10’s WebSocket protocol upgrade API Spring Boot 3.0 effectively ships EE 10 APIs and providers One exception: Jetty 11, since Jetty 12 is not final yet Note: Spring’s Servlet mocks are Servlet 6.0 (EE 10) based
  • 13.
  • 14.
    Spring AOT Reducing startuptime and memory footprint in production Runtime hints for reflection, resources, serialization, proxies Optional for optimized JVM deployments Precondition for GraalVM native executables AOT is a tradeoff: extra build setup and less flexibility at runtime
  • 15.
    GraalVM Native Image GraalVMas the de-facto standard for native executables Strong closed-world assumption, no runtime adaptations AOT-processed application as input → native executable Very long build time for actual native code generation A different mode of deployment with strong benefits and limitations
  • 16.
  • 22.
    Virtual Threads versusReactive Programming Virtual threads provide a different scalability mechanism Traditional imperative programming style, revisited Empowering Spring MVC to reach a new level of scalability Spring WebFlux as an architecture for stream-based processing Reactive: stream-based style, not primarily for scalability (anymore)
  • 23.
    Embracing Virtual Threads Higherscalability needed for Servlet deployments Or same concurrency but with a smaller footprint Best possible use of available CPU resources Virtual threads supported in GraalVM Native Image as well High expectations in the community
  • 24.
  • 25.
    Observability Observability is theability to observe the internal state of a running system from the outside. It consists of the three pillars logging, metrics and traces. Direct Observability instrumentation with Micrometer Observation in several parts of the Spring Framework. RestTemplate and WebClient are instrumented to produce HTTP client request observations. Spring Cloud Sleuth no longer needed for Distributed Tracing
  • 26.
  • 27.
  • 28.
    Spring Boot 3 HTTPInterface Client RFC 7807 Problem Details Spring Data 2022 Spring Security 6 Spring Authorization Server 1.0 Spring for GraphQL 1.1 More
  • 29.
  • 30.
    Spring Boot 3.1.0RC 1 Using Testcontainers at Development Time Docker Compose spring-boot-docker-compose module Building Docker Images with Maven or Gradle Dependency Upgrades https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-3.1.0-RC1-Release-Notes
  • 31.
  • 32.
    Spring Framework 6.0– available now Foundation for Spring Boot 3.0 & 3.1 Production-ready on JDK 17 LTS Regular stream of 6.0.x releases in 2023
  • 33.
    Spring Framework 6.1– November 2023 Foundation for Spring Boot 3.2 & 3.3 Production-ready on JDK 17 & 21 LTS Release candidate expected in September 2023
  • 34.
    Thank you 🙏 DanVega Spring Developer Advocate dvega@vmware.com