AMQP 1.0, OpenTelemetry conventions, LDAP SSL, shared build caches and faster startup

Spring Boot 4.2

Spring Boot 4.2.0 has been released on November 19, 2026. It is less about introducing a new API and more about improving standards, integrations and infrastructure.

The most dangerous Spring Boot upgrades are not the ones that fail to compile, but the ones that start cleanly, pass a tests and then send your API gateway a redirect it never expected.

Spring Boot 4.2 has a few of those. It also introduces some useful features, from native AMQP 1.0 integrations to registry-backed build caches.

⚡ TL;DR (Quick Recap)

  • AMQP 1.0: New generic and RabbitMQ-specific integrations.
  • Observability: OpenTelemetry semantic conventions, shared OTLP configuration and configurable tracing MDC keys.
  • LDAP: SSL bundle support for regular and embedded LDAP servers.
  • Buildpacks: Registry-backed build caches for ephemeral CI runners and a new Ubuntu 26.04-based builder.
  • Performance: Faster executable JAR startup through more efficient nested JAR and resource lookups.
  • Deprecations: RestTemplate, TestRestTemplate and Spring Boot's Apache Pulsar integration are deprecated.
  • Silent behavior changes: Tomcat redirects, forwarded headers, WebFlux multipart limits, Redis master/replica database selection and SSL bundle validation.

AMQP 1.0: A Second Messaging Protocol

Spring Boot’s traditional RabbitMQ integration has used AMQP 0–9–1. Spring Boot 4.2 introduces support for AMQP 1.0, an OASIS-standardized messaging protocol designed to improve interoperability between different brokers and client libraries.

There are now new integration options:

  • Generic AMQP 1.0 Built on Qpid ProtonJ2, this integration works with any AMQP 1.0-compliant broker. It is provided by: spring-boot-starter-amqp
  • RabbitMQ AMQP 1.0 RabbitMQ also has its own AMQP 1.0 integration, providing RabbitMQ-specific functionality. It is provided by: spring-boot-starter-amqp-rabbitmq

The catch: Existing RabbitMQ applications must choose. The introduction of AMQP 1.0 also changes the existing RabbitMQ starter arrangement.

The old RabbitMQ module has been renamed:

  • Module: spring-boot-amqp → spring-boot-rabbitmq
  • Package: org.springframework.boot.amqp → org.springframework.boot.rabbitmq
  • Starter: spring-boot-starter-amqp now provides generic AMQP 1.0 support.

The existing spring.rabbitmq.* configuration properties remain unchanged for classic RabbitMQ integration.

If you use spring-boot-starter-amqp, you must choose one of paths:

  • Existing RabbitMQ spring-boot-starter-rabbitmq
  • RabbitMQ's new integrationspring-boot-starter-amqp-rabbitmq
  • Generic AMQP broker integrationspring-boot-starter-amqp

For example, staying on the classic RabbitMQ integration requires changing the dependency:

Before:

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp</artifactId>
</dependency>

After:

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-rabbitmq</artifactId>
</dependency>

Or, if you want to adopt RabbitMQ’s AMQP 1.0 integration:

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-amqp-rabbitmq</artifactId>
</dependency>

These examples assume that Spring Boot dependency management is configured through the parent POM or BOM.

Configuration namespaces are different. The RabbitMQ AMQP 1.0 integration uses its own configuration:

spring:
amqp:
rabbitmq:
host: ${RABBITMQ_HOST}
username: ${RABBITMQ_USERNAME}
password: ${RABBITMQ_PASSWORD}
ssl:
bundle: example

There are two details:

  1. Username and password have no default values. Without credentials, the client authenticates anonymously.
  2. When an SSL bundle is configured, the default port becomes 5671.

Observability: Standards and Less Repetition

Spring Boot 4.1 expanded OpenTelemetry configuration. Spring Boot 4.2 builds on that with improvements.

OpenTelemetry Semantic Conventions (Opt-In) You can now enable OpenTelemetry semantic conventions for observations:

management:
observations:
conventions: open-telemetry

Consistent naming makes it easier to correlate telemetry across services and infrastructure components. Once enabled, customization properties such as:

management:
observations:
http:
server:
requests:
name: custom.http.server.requests

no longer take effect. If you depend on customized observation names, review your configuration before enabling the new conventions.

One OTLP Configuration for All Signals Configuring OTLP exporters often meant repeating the same endpoint, headers and compression settings across traces, metrics and logs.

Spring Boot 4.2 introduces common configuration:

management:
opentelemetry:
otlp:
endpoint: https://otel-collector.example.com
compression: gzip
headers:
Authorization: Bearer ${OTEL_TOKEN}

Signal-specific properties can still override the common settings. Headers are merged, with signal-specific values taking precedence when keys conflict.

For HTTP transport, Spring Boot automatically appends the appropriate signal path:

  • /v1/traces
  • /v1/logs
  • /v1/metrics

This makes configuration considerably easier to maintain.

Configurable Tracing MDC Keys Micrometer Tracing writes trace and span identifiers to the logging MDC.

The default keys are:

  • traceId
  • spanId

Spring Boot 4.2 lets you rename them:

management:
tracing:
mdc:
trace-id-key: trace_id
span-id-key: span_id

This applies to both OpenTelemetry and Brave. The default correlation ID in log output follows the new keys automatically.

LDAP: SSL Bundles

If you already use SSL bundles: certificates and keys live in one place instead of being configured separately for every integration.

Spring Boot 4.2 extends that model to LDAP.

Regular LDAP Connections You can configure an SSL bundle for an LDAP connection:

spring:
ldap:
urls: ldaps://ldap.example.com:636
ssl:
bundle: example

When an SSL bundle is configured, spring.ldap.urls defaults to:

ldaps://localhost:636

If you only need the platform’s default trust material rather than a dedicated bundle, you can use:

spring:
ldap:
ssl:
enabled: true

Embedded LDAP Server Embedded LDAP servers are common in integration tests. Previously, configuring SSL for an embedded server required additional coordination between the server and its client connection.

Spring Boot 4.2 allows you to configure an SSL bundle directly:

spring:
ldap:
embedded:
base-dn: "dc=spring,dc=io"
ssl:
bundle: example

Naming a bundle under spring.ldap.embedded.ssl.bundle configures both ends of the connection. Two changes are worth highlighting:

  • An SSL bundle is now required. Enabling SSL for an embedded LDAP server without configuring a bundle could silently start a plain LDAP listener. That behavior has changed. A bundle must now be provided.
  • Embedded LDAP supplies its own connection details. While the embedded server is running, the regular LDAP client properties are ignored:
  • spring.ldap.urls
  • spring.ldap.username
  • spring.ldap.password
  • spring.ldap.ssl.*

Use spring.ldap.embedded.credential.* for embedded-server credentials.

Silent changes: The Upgrade Risks

Some changes in Spring Boot 4.2 affect runtime behavior without necessarily breaking compilation. This are ones most likely to cause production surprises.

Forwarded Headers: A New Configuration Namespace Forwarded-header configuration is now unified under:server.request.header.forwarded

The old property:server.forward-headers-strategyis deprecated.
The new property is:server.request.header.forwarded.strategy

server:
request:
header:
forwarded:
strategy: framework # old 'native' is now 'web-server'
naming: x-forwarded # default; use rfc-7239 if your proxy sends the standard Forwarded header
use-prefix: true

There is another change.X-Forwarded-Prefix is now ignored by default. If your reverse proxy uses this header to expose an application under a path prefix, you must explicitly enable it.

Your application should only trust forwarded headers when they originate from a trusted reverse proxy. Accepting arbitrary client-supplied forwarding information can result in incorrect scheme, host or client-address information being used by the application.

Tomcat Relative Redirects
The property:server.tomcat.servlet.use-relative-redirectsnow defaults to true.

Previously, applications generally received absolute redirect URLs. Now, Tomcat can return relative Location headers. For example, an application might previously return:

Location: https://example.com/account/login

After upgrading, it may return:

Location: /account/login

Most browsers handle both correctly. However, some API gateways, reverse proxies and custom HTTP clients expect absolute redirect URLs. If you need the previous behavior, configure:

server:
tomcat:
servlet:
use-relative-redirects: false

This restores the previous absolute redirect behavior. Several Tomcat servlet properties have moved under server.tomcat.servlet.*.

WebFlux Multipart Limits WebFlux multipart limits were unlimited by default. Spring Boot 4.2 introduces defaults:

  • max-disk-usage-per-part is 1 MB
  • max-partsis 50

Applications accepting large uploads or multipart requests containing many parts may start rejecting requests after the upgrade. For example, an upload API might require:

spring:
webflux:
multipart:
max-disk-usage-per-part: 50MB
max-parts: 100

You can also remove these limits by setting the properties to -1:

spring:
webflux:
multipart:
max-disk-usage-per-part: -1
max-parts: -1

However, unlimited upload sizes are rarely a good production default.

Redis Master/Replica: Database Selection Now Works When using Redis master/replica configuration, the database configured through:spring.data.redis.databasewas silently ignored.

The connection factory always used database 0. Spring Boot 4.2 now applies the configured database.

spring:
data:
redis:
database: 2
masterreplica:
nodes:
- redis-master:6379
- redis-replica:6379

Before upgrading, the application actually used database 0. After upgrading, it uses database 2.

If your application intentionally relied on database 0, remove the database property or explicitly configure:

spring:
data:
redis:
database: 0

SSL Bundle Options Now Fail Fast Some SSL options were silently ignored by integrations that could not apply them.

This included:

  • options.ciphers
  • options.enabled-protocols

In Spring Boot 4.2, applications using bundles with these options can fail during startup when those bundles are used by:

  • gRPC clients and servers
  • LDAP clients and embedded LDAP servers
  • OTLP tracing and logging exporters

The important change is that configuration that was previously accepted but ignored may now prevent the application from starting.

Micrometer Changes in Tests Additional changes affect test environments:

  • MeterRegistry beans are no longer added to the global registry by default.
  • LongTaskTimer is no longer configured by default.

Buildpacks: Shared Caches and Ubuntu 26.04

CI runners are usually ephemeral, so a local Docker volume cache rarely helps: each build starts on a fresh machine with nothing cached.

Spring Boot 4.2 improves this situation by supporting image-based caches for buildCache. Cache layers can now be published to and restored from a container registry.

The workflow looks like this:

  1. One CI runner builds the application and publishes cache layers.
  2. Another runner downloads the cache from the registry.
  3. Subsequent builds reuse those layers instead of rebuilding everything.

This is particularly useful for Kubernetes-based CI infrastructure and distributed build environments.

A New Default Builder Spring Boot 4.2 changes the default builder from:

paketobuildpacks/builder-noble-java-tinyto:paketobuildpacks/ubuntu-resolute-builder

The new images are based on Ubuntu 26.04 instead of Ubuntu 24.04. There are details worth planning for:

  • Reproducibility The run image is no longer pinned to a specific version by the builder. If you need predictable and reproducible image builds, explicitly pin both the builder and run image.
  • Spring Cloud Bindings The Paketo Spring Boot buildpack enables Spring Cloud Bindings automatically. However, it is incompatible with Spring Boot 4.2 and can cause application startup failures.

Disable it during image building:

<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<image>
<builder>paketobuildpacks/builder-noble-java-tiny</builder>
<env>
<BP_SPRING_CLOUD_BINDINGS_DISABLED>true</BP_SPRING_CLOUD_BINDINGS_DISABLED>
</env>
</image>
</configuration>
</plugin>

This is a build-time environment variable, so make sure it is configured in your Maven, Gradle or CI image-building environment.

  • Shell Access Without an explicitly configured builder, the default run image has no shell. This matters when debugging containerized applications.

If you need to retain the previous builder, configure:

paketobuildpacks/builder-noble-java-tiny

You can continue using it explicitly instead of adopting the new default immediately.

Faster Startup for Executable JARs

Spring Boot 4.2 improves executable JAR startup. Previously, class and resource lookups opened a URL connection for every nested JAR lookup.

Spring Boot 4.2 looks up classes and resources directly in nested JARs instead. The result is less overhead during startup, including fewer allocations.

Related optimizations include:

  • More efficient reading of deflated nested JAR entries.
  • Faster resolution of cached resources.
  • Faster sorting of auto-configuration classes.
  • Faster DevTools restarts.

These optimizations are interesting for environments where application instances start frequently:

  • Kubernetes scale-outs.
  • Rolling deployments.
  • Serverless-style workloads.
  • Integration test suites.
  • Development environments using DevTools.

Startup time depends on application size, dependency count, JVM configuration, hardware and the amount of work performed during initialization. If startup performance matters to your application, benchmark it.

Deprecations

RestTemplate and TestRestTemplate Spring Framework 7.1 deprecates RestTemplate for removal. Spring Boot consequently deprecates its supporting infrastructure, including:

  • RestTemplateBuilder
  • RestTemplateCustomizer
  • RestTemplateAutoConfiguration
  • TestRestTemplate
  • Related test auto-configuration

The recommended direction is RestClient for production HTTP clients.

Before:

@Bean
RestTemplate restTemplate(RestTemplateBuilder builder) {
return builder
.rootUri("https://api.example.com")
.build();
}

After:

@Bean
RestClient restClient(RestClient.Builder builder) {
return builder
.baseUrl("https://api.example.com")
.build();
}

The request API also changes:

String response = restClient.get()
.uri("/users/{id}", 42)
.retrieve()
.body(String.class);

RestClient provides a synchronous, fluent API for making HTTP requests.

It is not a renamed RestTemplate. Existing request execution, error handling, interceptors and test infrastructure may need to be migrated as well.

For tests, TestRestTemplate is deprecated too. One alternative is RestTestClient.

@SpringBootTest
@AutoConfigureRestTestClient
class UserApiTest {
@Autowired
private RestTestClient restTestClient;
@Test
void shouldReturnUser() {
restTestClient.get()
.uri("/users/42")
.exchange()
.expectStatus()
.isOk();
}
}

Apache Pulsar Spring for Apache Pulsar 2.0.8 is its final release under the Spring umbrella. The project has moved to the Apache Software Foundation and is now maintained under the Apache Pulsar project.

As a result, Spring Boot’s spring-boot-starter-pulsar integration is deprecated.

Final Takeaways

Spring Boot 4.2 improves the infrastructure around your applications.

The five changes worth remembering are:

  • AMQP 1.0: Broader broker interoperability, but existing RabbitMQ applications must choose a new starter.
  • Observability: Standard OpenTelemetry naming, shared OTLP configuration and flexible MDC keys.
  • LDAP SSL: A consistent SSL bundle model for regular and embedded LDAP connections.
  • Buildpacks: Registry-backed caches for ephemeral CI runners and a new Ubuntu 26.04-based builder.
  • Startup: More efficient class and resource lookups in executable JARs.

Spring Boot 4.2 is both a feature release and an opportunity to modernize existing applications.

Originally posted on marconak-matej.medium.com.