Spring bootIntermediate

Spring Boot 4.2: What's New and Who Should Upgrade

DeveloperHat Team
11 min read

TL;DR

Spring Boot 4.2.0 shipped Nov 19, 2026, with AMQP 1.0, OpenTelemetry conventions and faster startup. What changed, what upgrading costs, and who should wait.

Spring Boot 4.2.0 was released on November 19, 2026, and is available on Maven Central now. It is the latest stable release on the 4.x line, and the Spring team followed it a day later with maintenance releases for the two older lines — 4.1.3 and 4.0.10, both on November 20. If you run Spring Boot in production, the release that matters most to you depends on which line you are on: 4.2 is a polish release, 4.0 is about to lose free support, and 3.5 already has.

The short version: if you are on 4.1, upgrading to 4.2 is a version bump and a test run. If you are on 4.0, the upgrade is the same size, but the deadline is real — open-source support for 4.0 ends December 31, 2026. If you are still on 3.5, skip the intermediate lines and go straight to 4.2 as a planned migration sprint. What follows is what actually changed, the three 4.x platform features that matter more than the release notes suggest, and the decision written down so your team can argue with it.

Six highlights, one theme: production polish Spring Boot 4.2.0 GA · 19 Nov 2026 AMQP 1.0 generic + RabbitMQ OTel conventions opt-in, renames metrics LDAP SSL bundles incl. embedded server Buildpack caches shared registry cache Faster jar startup executable jars boot quicker The deprecations matter more than the features for most teams — RestTemplate is now on the way out.

What's actually new in 4.2.0

The Spring Boot 4.2.0 announcement lists six highlights, and none of them is a rewrite. That is the point — 4.2 is a minor release that pays down production friction:

  • AMQP 1.0 support, both generic and tailored for RabbitMQ. If your messaging runs on AMQP 1.0 — RabbitMQ 4.x speaks it natively — Boot now auto-configures it instead of leaving you to wire the client by hand. Teams on the older AMQP 0-9-1 protocol are unaffected; nothing is removed.
  • Opt-in OpenTelemetry semantic conventions. Set management.observations.conventions=open-telemetry and Boot emits metrics and spans using OpenTelemetry's naming instead of Micrometer's defaults. The catch is in the name: it renames things. http.server.requests becomes the OTel equivalent, so any dashboard, alert, or log query that reads Micrometer names goes quiet until you update it. Our OpenTelemetry production guide covers the sampling and cardinality side of the same decision. Flip this switch in staging first, with your dashboards open.
  • SSL bundle support for LDAP, including the embedded LDAP server. SSL bundles are Boot's way of centralizing TLS material — one bundle, referenced by every client that needs it — and LDAP joins the list of clients that can use one. If your services authenticate against LDAP over TLS, this removes a block of per-service trust-store wiring.
  • Registry-backed build caches for Cloud Native Buildpacks. CI runners can now share a warm build cache through the registry, so the second build on a fresh runner stops paying the full download-and-compile cost. Images built with buildpacks are also now based on Ubuntu 26.04 by default. Buildpack output is a standard OCI image, so the same Docker best practices — small layers, pinned bases, scanned images — apply to what comes out.
  • Faster startup of executable jars. Spring claims quicker boots for executable jars with no configuration change. No numbers are published with the release, so treat this as a free improvement to measure rather than a reason to upgrade on its own.
  • Dependency upgrades across the portfolio. Boot 4.2 moves to Spring Framework 7.1.0, Spring Security 7.2.0, Spring Data 2026.1.0, Spring Batch 6.1.0, plus new Kafka, AMQP, Integration, and GraphQL releases. If you pin any of those directly, check the version your BOM now manages before you override it.
  • The deprecations deserve more attention than the features. RestTemplate and TestRestTemplate are deprecated in favor of RestClient and RestTestClient, and Apache Pulsar support is deprecated following Pulsar's move to the Apache Software Foundation. Deprecated means your code still compiles and runs — these are warnings, not removals — but the direction is set. The RestClient migration is mechanical:

    // Before — still works in 4.2, but deprecated
    RestTemplate rest = new RestTemplate();
    String body = rest.getForObject("https://api.example.com/orders/{id}", String.class, id);
    
    // After — the supported client going forward
    RestClient client = RestClient.builder()
            .baseUrl("https://api.example.com")
            .build();
    String body = client.get().uri("/orders/{id}", id).retrieve().body(String.class);

    Migrate RestTemplate calls when you touch the surrounding code, not in one heroic sweep. For Pulsar, start planning the exit — either the community-supported starter or a different client — but there is no deadline attached to this deprecation yet.

    The 4.x platform underneath

    The 4.2 highlights are small. The platform they sit on is not, and it is the real reason 4.x feels different from 3.x. Three changes from the 4.0 generation do most of the work.

    Modular starters: a dependency on a library no longer activates it

    In Spring Boot 3.x, one large spring-boot-autoconfigure jar held the auto-configuration for every technology, and a feature switched on as soon as its library appeared on the classpath. In 4.0 the jar was split into small per-technology modules, each with its own starter — spring-boot-starter-data-jpa, spring-boot-starter-flyway, and so on. The practical consequence catches people during upgrades: a dependency on a plain library, such as flyway-core, no longer activates its Spring Boot support. You need the starter, or the migrations never run and the application starts without an error. If a 4.x upgrade "loses" a feature silently, a missing starter is the first place to look.

    The stack, layer by layer Your application — controllers · services · repositories Spring Boot 4.2 — starters + auto-configuration modules Spring Framework 7.1 — Web MVC · Data · Security · AMQP Platform — Jakarta EE 11 · Java 17–25 · Tomcat 11 Each layer is a module you can reason about separately — and upgrade separately.

    Built-in API versioning: the version is part of the mapping

    Spring Framework 7, the foundation of Boot 4, adds first-class API versioning. A version attribute on @RequestMapping and every shortcut variant lets one path fan out to multiple handlers, and the framework handles resolution, matching, and rejection of unknown versions. Before this, every team built its own versioning with path prefixes, header parsing in an interceptor, or parallel controller classes that drifted out of sync.

    @RestController
    @RequestMapping("/accounts")
    public class AccountController {
    
        @GetMapping(path = "/{id}", version = "1.0")
        public AccountV1 getAccountV1(@PathVariable Long id) {
            return accounts.findV1(id);
        }
    
        @GetMapping(path = "/{id}", version = "2.0")
        public AccountV2 getAccountV2(@PathVariable Long id) {
            return accounts.findV2(id);
        }
    }

    You choose how the client states its version — header, path segment, query parameter, or media-type parameter — and declare it once, in Java config or in properties:

    spring.mvc.apiversion.supported=1.0,2.0
    spring.mvc.apiversion.default=1.0
    spring.mvc.apiversion.use.header=X-API-Version

    Two conventions matter. Pick one strategy per API and stick to it — mixing header and path versioning in the same service confuses every client. And version the API, not the URL: the path stays /accounts/{id} while the version rides in the header, which keeps links stable across releases. The API versioning guide by Dan Vega walks through all four strategies with working code if you want the full comparison.

    Virtual threads: one property, real limits

    Virtual threads arrived as an opt-in in Boot 3.2 and are a first-class, recommended option in the 4.x line on Java 21 and later. The switch is a single property:

    # Needs Java 21 or later at runtime
    spring.threads.virtual.enabled=true

    With it on, Boot uses virtual threads for its internal task executors, so blocking I/O-bound code — the typical Spring web workload — scales to far more concurrent requests without the thread-per-request memory cost. Two honest limits. Virtual threads help I/O-bound work; a CPU-bound endpoint gains nothing and can get slower from scheduling overhead. And long synchronized sections can pin a virtual thread to its carrier thread, so audit those before flipping the switch on a service that leans on coarse locking. Measure with your own load test: the property is one line to enable and one line to roll back.

    The baseline around all of this: Java 17 is still the minimum, Java 25 is the current LTS and the recommended runtime, and the platform is Jakarta EE 11 with Jackson 3 and JUnit 6 underneath. If you are coming from 3.5, that baseline jump — not any single feature — is what makes the migration a sprint rather than an afternoon.

    Head-to-head: 4.0 vs 4.1 vs 4.2

    LineReleasedSpring FrameworkFree support endsThe one-line story
    4.0November 20257.031 Dec 2026The new generation: modular starters, API versioning, Jakarta EE 11
    4.1June 20267.031 Jul 2027The stable line most teams run today
    4.219 Nov 20267.131 Dec 2027AMQP 1.0, OTel conventions, faster startup, RestTemplate deprecated

    The support dates come from endoflife.date's Spring Boot tracker, which mirrors the Spring team's published support windows. The pattern to internalize: each minor line gets roughly thirteen months of free support, and a new minor ships about every six months. Staying current means small upgrades twice a year, not a big-bang migration — which is exactly the habit 4.2 rewards and 3.5 punishes.

    Architecture decision: adopt Spring Boot 4.2

  • Decision: Adopt Spring Boot 4.2.0 as the default for new services. Upgrade 4.0 services before December 31, 2026. Upgrade 4.1 services on their next planned sprint, not as an emergency.
  • Context: 4.2.0 is the current stable release (November 19, 2026). Free support for 4.0 ends December 31, 2026; free support for 3.5 ended June 30, 2026. Running either past its date means running without free security patches.
  • Options considered: (a) Stay on 4.1.3, the current patched line. (b) Move to 4.2.0 now. (c) Wait for the next minor, roughly six months out. (d) Stay on 3.5 and buy commercial support.
  • Why this one: 4.2 is a minor upgrade from 4.1 with no breaking changes beyond deprecations, so the cost is a test run. Option (a) is fine for a few months but just defers the same work. Option (c) leaves 4.0 teams past their support deadline. Option (d) only makes sense if a 3.5 migration is genuinely blocked.
  • What it costs you: A version bump, a full test-suite run, and a review of RestTemplate usages (deprecation warnings, not breakage). OTel dashboards need re-checking only if you flip the conventions switch — which is opt-in and separate from the upgrade itself.
  • When to reverse it: If a regression appears in staging, pin back to 4.1.3. Same major line, same Framework generation, low rollback cost. Revisit the decision if the next minor ships a breaking change that 4.2's deprecations were warning about.
  • Pick by the line you are on, not by the headline Where are you now? pick your current line On 4.0.x OSS ends 31 Dec 2026 On 4.1.x supported to Jul 2027 On 3.5 or older OSS ended Jun 2026 Upgrade to 4.2 now test suite first Move to 4.2 next sprint small, safe step Go straight to 4.2 budget a migration sprint New project? Start on 4.2.0 — there is no reason to onboard onto a line you will migrate off.

    Recommendation

    For a new service, start on 4.2.0 with Java 25, virtual threads on if the workload is I/O-bound, and RestClient for all new HTTP calls. That combination is the current default the platform is steering toward, and it costs nothing extra to adopt at the start.

    For an existing service on 4.1, upgrade in the next sprint: bump the parent to 4.2.0, run the suite, and ship it. Keep the OTel conventions switch off until you have a staging window to watch your dashboards rename themselves. Migrate RestTemplate calls opportunistically as you touch files.

    For a service on 4.0, the same upgrade, but treat December 31, 2026 as a hard deadline on your calendar, not a vague intention. The work is identical; the urgency is the support window.

    For a service on 3.5 or older, do not target 4.0 or 4.1 as stepping stones — go straight to 4.2 and budget a migration sprint. The breaking surface is the 3-to-4 jump (Jakarta EE 11, Framework 7, Jackson 3, JUnit 6, modular starters), and you pay it once either way. Use the sprint to fix the things the migration exposes: missing starters, hand-rolled API versioning you can now delete, and any javax imports that survived the 3.x move.

    When NOT to upgrade (yet)

  • You are in a change freeze or mid-incident. The 4.1-to-4.2 upgrade is small, but it is not zero — a dependency table moved under you, and that deserves a green test suite and a normal deploy window, not a Friday afternoon.
  • Your Pulsar usage is load-bearing and unmigrated. Pulsar support still works in 4.2, so this is not a blocker — but upgrade with a plan for where Pulsar goes next, rather than discovering the deprecation in a post-upgrade audit.
  • Your OTel dashboards are business-critical and nobody owns them. The upgrade itself does not rename your metrics — only the opt-in conventions switch does. Keep the switch off, upgrade, and schedule the rename as its own change with the dashboard owner in the room.
  • You are on 3.5 with a large, untested codebase. The 3-to-4 jump changes the platform underneath your code. Do it as a planned sprint with a rollback plan, not as a drive-by version bump. The container image guidance is worth re-reading before that sprint if your services ship as container images — the buildpack and base-image defaults moved too.
  • Why This Matters

    Understanding the business and technical context helps you make informed decisions rather than blindly following patterns.

    Trade-offs to Consider

    Every architectural decision involves trade-offs. Consider your specific requirements, team expertise, and scale when evaluating options.

    When NOT to Use This

    Knowing when a solution doesn't apply is as valuable as knowing when it does. Consider alternatives for your specific situation.

    Decision Framework

    Use this framework to evaluate whether this approach is right for your use case based on your specific constraints and requirements.

    Share this articleShare on XShare on LinkedIn

    Keep the decision frameworks coming

    One practical architecture guide a week — patterns, trade-offs, and when not to use them. No spam, unsubscribe anytime.