Skip to content

Spring Boot 3.2.0 RC1 Release Notes

Andy Wilkinson edited this page Nov 3, 2023 · 14 revisions

Spring Boot 3.2.0-RC1 Release Notes

For changes in earlier milestones, please refer to:

Upgrading from Spring Boot 3.1

Auto-configured User Details Service

The auto-configured InMemoryUserDetailsManager now backs off when one or more of spring-security-oauth2-client, spring-security-oauth2-resource-server, and spring-security-saml2-service-provider is on the classpath. Similarly, in reactive applications, the auto-configured MapReactiveUserDetailsService now backs off when one or more of spring-security-oauth2-client and spring-security-oauth2-resource-server is one the classpath.

If you are using one of the above dependencies yet still require an InMemoryUserDetailsManager or MapReactiveUserDetailsService in your application, define the required bean in your application.

Oracle UCP DataSource

The Oracle UCP DataSource no longer sets validateConnectionOnBorrow to true by default. If you need to restore the old behavior you can set the spring.datasource.oracleucp.validate-connection-on-borrow application property to true.

Nested Jar Support

The underlying code that supports Spring Boot’s "Uber Jar" loading has been rewritten now that we no longer need to support Java 8. The updated code makes use of a new URL format which is more compliant with JDK expectations. The previous URL format of jar:file:/dir/myjar.jar:BOOT-INF/lib/nested.jar!/com/example/MyClass.class has been replaced with jar:nested:/dir/myjar.jar/!BOOT-INF/lib/nested.jar!/com/example/MyClass.class. The updated code also makes use of java.lang.ref.Cleaner (which was part of JDK 9) for resource management.

We have made every effort to ensure that, as much as possible, the new code is a transparent replacement for the previous implementation. We do not anticipate that most users will even notice the change. One area where you may notice a change is if you were referring to one of the launcher classes directly as they have new names in the new default launcher:

New Classic

org.springframework.boot.loader.launch.JarLauncher

org.springframework.boot.loader.JarLauncher

org.springframework.boot.loader.launch.PropertiesLauncher

org.springframework.boot.loader.PropertiesLauncher

org.springframework.boot.loader.launch.WarLauncher

org.springframework.boot.loader.WarLauncher

If you do find issues with the new implementation, however, we have provided a fallback option that will allow you to use the old code.

For Gradle users you can set the bootJar.loaderImplementation to org.springframework.boot.loader.tools.LoaderImplementation.CLASSIC. For example:

bootJar {
  loaderImplementation = org.springframework.boot.loader.tools.LoaderImplementation.CLASSIC
}

For Maven users, you can set the <loaderImplementation> tag on the spring-boot-plugin configuration to CLASSIC. For example:

<build>
  <plugins>
    <plugin>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>repackage</goal>
            </goals>
            <configuration>
              <loaderImplementation>CLASSIC</loaderImplementation>
            </configuration>
          </execution>
        </executions>
    </plugin>
  </plugins>
</build>

If you find any unexpected behavior with the new implementation, please raise a GitHub issue.

Minimum Requirements Changes

None.

New and Noteworthy

Tip
Check the configuration changelog for a complete overview of the changes in configuration.

Virtual threads

Keeping the JVM Alive

There’s a new property called spring.main.keep-alive. When set to true, the JVM is kept alive, even if all other threads are virtual (or daemon) threads.

Spring for Apache Pulsar

When virtual threads are enabled, Spring for Apache Pulsar will now be configured to use them. Specially the auto-configured ConcurrentPulsarListenerContainerFactory will use a VirtualThreadTaskExector for its consumer task executor. Similarly, the auto-configured DefaultPulsarReaderContainerFactory will use a VirtualThreadTaskExecutor for its reader task executor.

Jms Sessions

New properties have been introduced for configuring the sessions created by the auto-configured JmsTemplate:

  • spring.jms.template.session.acknowledge-mode

  • spring.jms.template.session.transacted

Similarly, a spring.jms.listener.session.transacted property has been introduced for the auto-configured JmsMessageListenerContainer.

To align with these new properties, please note that the existing spring.jms.listener.acknowledge-mode property has been deprecated and spring.jms.listener.session.acknowledge-mode has been introduced as a replacement.

Limited Message Body Size with RabbitMQ

Recent versions of the Java client for RabbitMQ limit the maximum size of the body of an inbound message to 64MB by default. For the customization of this limit, the spring.rabbitmq.max-inbound-message-body-size configuration property has been introduced.

Connection validation on Oracle UCP datasources

The default for connection validation on Oracle UCP datasources has been removed. Before 3.2.0-RC1 connection validation was enabled by default, this is no longer the case. If you need connection validation, set the configuration property spring.datasource.oracleucp.validate-connection-on-borrow to true.

testAndDevelopmentOnly Gradle Configuration

In addition to developmentOnly, Spring Boot’s Gradle plugin now also creates a testAndDevelopmentOnly configuration. Unlike developmentOnly, dependencies in this new configuration are included in the test compile and runtime classpaths. It is primarily intended for applications that are using Testcontainers at development time.

Observability improvements

You can now use Micrometer’s @Timed, @Counted, @NewSpan and @ContinueSpan annotations. The aspects for them are now auto-configured if you have AspectJ on the classpath.

There’s a new configuration property named spring.reactor.context-propagation, which controls the context propagation in reactive pipelines. To automatically propagate observations, trace ids and span ids in your reactive pipelines, set the property to auto.

SSL Bundles

Reloading

SSL bundles can now be automatically reloaded when the trust material changes. A bundle must opt in to this functionality by settings its reload-on-update property to true. The consumer of the bundle must also support reloading.

Consumers that support reloading are:

  • Netty web server

  • Tomcat web server

More information about reloading of SSL bundles can be found in the reference documentation.

Support for RabbitMQ and Apache Kafka

RabbitMQ and Apache Kafka connections can now be configured to use SSL trust material from an SSL bundle with spring.rabbitmq.ssl.bundle and spring.kafka.ssl.bundle properties, as an alternative to providing trust material as Java keystore files using existing spring.rabbitmq.ssl and spring.kafka.ssl properties.

Miscellaneous

Apart from the changes listed above, there have also been lots of minor tweaks and improvements including:

  • The WebClient based Zipkin sender now honors the timeouts set through the configuration properties.

  • Any TransactionExecutionListener beans are now added to the auto-configured transaction manager.

  • Transaction manager customization now applies to any type of TransactionManager, not just PlatformTransactionManager.

  • Awaitility (org.awaitility:awaitility) is now part of spring-boot-starter-test.

  • Add property to verify keys when using PEM SSL bundles.

  • Add support for CSP authentication when using Wavefront.

  • The restTemplateBuilderConfigurer bean is no longer backing off on user-defined beans. If you had your own restTemplateBuilderConfigurer bean, please remove it. See #36264 for details.

  • The features declared in Jackson’s EnumFeature and JsonNodeFeature can now be enabled and disabled using the configuration properties spring.jackson.datatype.enum. and spring.jackson.datatype.jsonnode. respectively.

  • Additional build info properties can now have lazy values by using a Provider.

  • When auto-configuring MockMvc, filters are now registered using the dispatcher types and init parameters from their registration bean.

  • Testcontainers can now be initialized in parallel. For this, set spring.testcontainers.beans.startup to parallel.

Deprecations in Spring Boot 3.2.0-RC1

  • Configuration property spring.jms.listener.concurrency with replacement spring.jms.listener.min-concurrency.

  • Configuration property spring.jms.listener.acknowledge-mode with replacement spring.jms.listener.session.acknowledge-mode.

  • PlatformTransactionManagerCustomizer with replacement TransactionManagerCustomizer

  • TransactionManagerCustomizers(Collection<? extends PlatformTransactionManagerCustomizer<?>>) with replacement TransactionManagerCustomizers#of(Collection<? extends TransactionManagerCustomizer<?>>)

Clone this wiki locally