Spring Tips: Spring Boot 3.2 https://www.youtube.com/watch?v=dMhpDdR6nHw&list=PLiMnE9gXWStCaXgeij3ZdanSjVCBIlKFA
Below is a list of the main topics covered in the transcript from the "Spring Tips" installment featuring Spring Boot 3.2, presented by Josh Long, formatted in Markdown. The approximate timestamps indicate when each topic begins, derived from the provided document.
-
Introduction and Spring Boot 3.2 GA Announcement
- Time: 0:16
- Details: Josh welcomes viewers to "Spring Tips," announcing the imminent Spring Boot 3.2 General Availability (GA) release, highlighting features like virtual threads (Project Loom), Project CRaC, improved observability, and reloadable SSL support.
-
Java 21 as a Compelling Upgrade
- Time: 1:06
- Details: Josh introduces Java 21 as a significant upgrade for Spring Boot 3.2, emphasizing its syntax improvements and features like Project Loom, even though it’s not required.
-
Data-Oriented Programming in Java 21
- Time: 1:51
- Details: Josh explains Java 21’s shift toward data-oriented programming with features like sealed types, pattern matching, smart switch expressions, and records, contrasting it with traditional monolithic hierarchies.
-
Building a Java 21 Program with Sealed Types and Records
- Time: 3:44
- Details: Josh demonstrates creating a simple Java 21 program within a Spring Boot 3.2 context, using sealed types (
Loan,SecuredLoan,UnsecuredLoan) and records to model a loan system.
-
Pattern Matching and Smart Switch Expressions
- Time: 7:40
- Details: Josh enhances the loan example with pattern matching and smart switch expressions to handle type checking and ensure exhaustive case coverage, improving type safety.
-
Introduction to Project Loom and Virtual Threads
- Time: 11:27
- Details: Josh introduces Project Loom’s virtual threads in Java 21, explaining their importance and how they address the limitations of traditional blocking threads.
-
Virtual Threads vs. Traditional Threads
- Time: 18:07
- Details: Josh demonstrates virtual threads with a practical example, contrasting them with platform threads using an array of 1,000 threads, showing how virtual threads switch underlying OS threads seamlessly.
-
Integrating Virtual Threads in Spring Boot 3.2
- Time: 25:00
- Details: Josh shows how to enable virtual threads in Spring Boot 3.2 with the
spring.threads.virtual.enabled=trueproperty, making it a system-wide toggle for scalability.
-
New JDBC and Rest Clients in Spring Boot 3.2
- Time: 28:41
- Details: Josh introduces the new
JdbcClientandRestClientin Spring Framework 6.1 (part of Spring Boot 3.2), offering fluent DSLs as alternatives toJdbcTemplateandRestTemplate.
-
Building a Data-Centric App with JdbcClient
- Time: 31:19
- Details: Josh builds a Spring Boot app using
JdbcClientto query a PostgreSQL database via Testcontainers, setting up schema and data initialization.
-
Creating a REST Controller with JdbcClient
- Time: 36:03
- Details: Josh creates a
CustomerControllerto expose customer data from the database, leveraging DevTools for rapid iteration.
-
Using RestClient for External API Calls
- Time: 37:52
- Details: Josh demonstrates
RestClientto fetch data from the Cat Fact API, configuring it with a modern HTTP client and creating aCatFactController.
-
Declarative HTTP Clients
- Time: 42:29
- Details: Josh refactors the
RestClientexample into a declarative interface (CatClient) using@GetExchange, simplifying the code further.
-
Improving Startup Time with DevTools
- Time: 44:18
- Details: Josh discusses Java’s slow startup time and demonstrates how Spring Boot DevTools reduces restart time from 0.622 seconds to 0.1 seconds by keeping the JVM warm.
-
Project CRaC for Instant Startup
- Time: 47:15
- Details: Josh introduces Project CRaC (Coordinated Restore at Checkpoint) to snapshot and restore a Java app’s memory, showing its integration in Spring Boot 3.2.
-
Implementing CRaC with Lifecycle Hooks
- Time: 50:41
- Details: Josh builds a stateful component implementing CRaC’s
Resourceinterface (mapped to Spring’sSmartLifecycle) to manage state during checkpoint and restore.
-
Running CRaC in Docker
- Time: 53:54
- Details: Josh uses a Dockerfile with Ubuntu and a CRaC-compatible JDK to build and run the app, demonstrating a checkpoint reducing startup from 0.9 seconds to 57 milliseconds.
-
Reloadable SSL Bundles in Spring Boot 3.2
- Time: 57:20
- Details: Josh introduces reloadable SSL bundles, enhancing Spring Boot 3.1’s SSL support, allowing dynamic certificate updates without restarting the app.
-
Configuring SSL with a Self-Signed Certificate
- Time: 59:01
- Details: Josh configures an SSL bundle with a self-signed certificate, securing a simple controller and testing it with
curlon port 8443.
-
Dynamic SSL Reload Demonstration
- Time: 1:03:20
- Details: Josh enables
reload.on-update=trueand shows how the app reloads a new certificate (beautiful-2) when updated, maintaining security seamlessly.
-
Unified Observability with Micrometer
- Time: 1:05:14
- Details: Josh discusses Spring Boot 3.0’s unification of tracing and metrics under Micrometer, improved further in 3.2 with features like observation disabling and default key-values.
-
Building an Observable App with Zipkin
- Time: 1:07:36
- Details: Josh builds an app with a declarative
CatFactsclient, integrating Zipkin for distributed tracing and Docker Compose for setup.
-
Adding Logging and AOP for Observability
- Time: 1:13:18
- Details: Josh enhances observability with AOP (
@Observed) and logging, displaying trace and span IDs in logs for local debugging.
-
Explicit Observation with Metrics
- Time: 1:15:44
- Details: Josh demonstrates explicit observation using
Observation.createNotStarted, adding custom metrics and tags (e.g.,region=us-west).
-
Viewing Metrics via Actuator
- Time: 1:19:07
- Details: Josh exposes metrics via the Actuator endpoint (
/actuator/metrics), showing request counts and timings, with improved Prometheus exemplar support.
-
Closing Remarks and Encouragement
- Time: 1:20:53
- Details: Josh wraps up, encouraging viewers to upgrade to Spring Boot 3.2 and Java 21, highlighting benefits like virtual threads, GraalVM, and production readiness.