Spring Boot 4.2.0-M1 Released: RestTemplate Deprecated, AMQP 1.0 Support Added, Major Dependency Upgrades

Spring Boot 4.2.0-M1 milestone release deprecates RestTemplate in favor of RestClient, adds AMQP 1.0 support, introduces Buildpacks image-layer caching, removes deprecated APIs, fixes numerous bugs including structured logging and Kafka consumer security, and upgrades 20+ dependencies including Hibernate, Kafka, Kotlin, and Tomcat.

Java Architecture Diary
Java Architecture Diary
Java Architecture Diary
Spring Boot 4.2.0-M1 Released: RestTemplate Deprecated, AMQP 1.0 Support Added, Major Dependency Upgrades

Overview

Spring Boot 4.2.0-M1 is the first milestone release of the Spring Boot 4.2 series, available from Maven Central as a pre-release version. It includes breaking feature enhancements, dependency upgrades, and bug fixes.

New Features

Improved Jetty server forwarded request header configuration.

Disabled Micrometer global Registry by default in test environments to reduce test context pollution from global state.

Jetty graceful shutdown now uses GracefulHandler for coordination instead of StatisticsHandler.

Marked Spring Boot's RestTemplate support as deprecated; the direct replacement is RestClient. Both are synchronous, blocking HTTP clients, so existing Spring MVC projects need not forcibly adopt reactive programming.

Marked TestRestTemplate as deprecated; recommended replacement is RestTestClient.

Adjusted forwarded header configuration to align with Reactor Netty and Spring Framework changes.

Removed deprecated APIs scheduled for removal in Spring Boot 4.2 (see Deprecated API Removals section).

Buildpacks added image-based build cache support.

Provided plugin version management for hibernate-maven-plugin.

Added timeout configuration to RetryPolicySettings.

Added self-reference return to ApplicationContextAssertProvider.

Kafka Streams added leaveGroupOnClose configuration property. ApplicationHome and ApplicationTemp gained Path -based access methods.

Official AMQP 1.0 support added, including generic AMQP 1.0 client and RabbitMQ-specific AMQP 1.0 client with RabbitMQ-exclusive features.

Renamed spring-boot-amqp to spring-boot-rabbitmq.

Improved spring-boot.run.useTestClasspath handling of target/test-classes.

Deprecated API Removals

The following deprecated classes have been removed:

EnvironmentPostProcessor
HttpMessageConverters
ZipkinWithOpenTelemetryTracingAutoConfiguration
DeprecatedMongoDbContainerConnectionDetailsFactory
DeprecatedNeo4jContainerConnectionDetailsFactory
DeprecatedPulsarContainerConnectionDetailsFactory
DeprecatedRabbitContainerConnectionDetailsFactory
DeprecatedMariaDbR2dbcContainerConnectionDetailsFactory
DeprecatedMySqlR2dbcContainerConnectionDetailsFactory
DeprecatedPostgresR2dbcContainerConnectionDetailsFactory
DeprecatedSqlServerR2dbcContainerConnectionDetailsFactory

RestTemplate Migration

The direct replacement for RestTemplate is RestClient. Both are synchronous, blocking HTTP clients, so existing traditional Spring MVC projects do not need to forcibly rewrite to reactive programming for this deprecation.

Bug Fixes

Fixed structured logging JSON encoding failure potentially contaminating the next log on the same thread.

Fixed Kafka consumer dedicated security protocol configuration not taking effect.

No longer incorrectly exposes gRPC test server port when gRPC is not introduced.

Fixed Micrometer Registry holding application context, preventing context release.

Fixed temporary files not deleted after exported image TAR build failure.

Fixed spring.grpc.server.health.include-overall-health configuration not taking effect.

Fixed configuration metadata processor ignoring @NestedConfigurationProperty on record getters.

Fixed spring-boot-h2-console incorrectly pulling in Servlet API.

Fixed PropertiesLauncher not logging nested archive paths.

Corrected missing @Nullable declaration on some Map#remove return methods.

Fixed Flyway subdirectory migration paths being flattened in Native Image environments.

Fixed Kotlinx Serialization CodecCustomizer ordering issue.

Fixed JarFile not closed when locating main class from archive files.

Dependency Upgrades

Hibernate ORM 7.4.5.Final

Hibernate Validator 9.1.3.Final

Jackson 3.1.5, Jackson 2.21.5

Kafka 4.3.1

Kotlin 2.4.10

JUnit Jupiter 6.1.3

Jetty 12.1.12

Tomcat 11.0.24

Netty 4.2.17.Final

Flyway 12.11.0

Elasticsearch Client 9.5.0

Jedis 8.0.0

Lettuce 7.6.0.RELEASE

HikariCP 7.1.0

Log4j 2.26.1

Logback 1.6.1

OpenTelemetry 1.64.0

gRPC Java 1.83.1

Gson 2.14.0

PostgreSQL JDBC 42.7.13

Pulsar 4.2.4

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

RestTemplateRestClientJava FrameworkMigration GuideDependency UpgradesBuildpacksAMQP 1.0Spring Boot 4.2
Java Architecture Diary
Written by

Java Architecture Diary

Committed to sharing original, high‑quality technical articles; no fluff or promotional content.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.