New Features
The new features which are available in Spring Boot 2.0 version are:
- Support constructor binding for property nested inside a JavaBean
- Add config property for CodecConfigurer.maxInMemorySize in WebFlux
- Make test slices' type exclude filters public
- Support amqps:// URIs in spring.rabbitmq.addresses
Performance Improvements
In Spring Boot 2.2.1 the following performance has been improved:
Lazy Initialization
In Spring Boot 2.2.1, we can enable global lazy initialization by using the property spring.main.lazy-initialization property. It reduces the application startup time.
Java 13 Support
Spring Boot 2.2.1 now supports the latest version of Java that is Java 13.
Immutable Binding
In the newer version of Spring Boot, Configuration properties support constructor-based binding. The class annotates with @ConfigurationProperties annotation is to be immutable. It can be enabled by adding an annotation @ConfugurationProperties to a class or one of its constructors with @ConstructorBinding.
RSocket Support
It is a part of Spring Security. RSocket integration is auto-configured when an application finds spring-security-rsocket is present on the classpath.
Dependency Upgrades
Some dependencies that have been upgraded in Spring Boot v2.2.1 are as follows:
- MongoDB 3.11.2
- Spring Security 5.2.1.RELEASE
- Slf4j 1.7.29
- Spring Hateoas 1.0.1.RELEASE
- Hibernate Validator 6.0.18.Final
- Hibernate 5.4.8.Final
- Jetty 9.4.22.v20191022
- Spring Framework 5.2.1
- Spring AMQP 2.2.1
- H2 1.4.200
- Spring Security 5.2
- Spring Batch 4.2
Some important and widely used third-party dependencies are upgraded in this release are as follows:
- Micrometer 1.3.1
- Flyway 6.0.7
- Elasticsearch 6.8.4
- JUnit 5.5
- Jackson 2.10
Deprecations in Spring Boot 2.2
The deprecations of the Spring Boot 2.2 version are as mentioned below:
- The property logging.file has been renamed to logging.file.name.
- The property logging.path has been renamed to logging.file.path.
- The server.connection-timeout property has been deprecated in favour of server-specific properties.
- Joda time support is deprecated in favour of java.time.
Overall Improvements
The following improvements are made in the Spring Boot 2.2.1:
- Java: Spring Boot 2.2.1
- Spring Framework 5.2: This release of Spring Boot upgrades to Spring Framework to 5.2.
- JMX is disabled: In this version, JMX is not enabled by default. We can enable it by using the property jmx.enabled=true. If you are using the IDE feature to monitor your application, we need to enable it.
- Fork enabled by default: Spring Boot application that ran by Maven Plugin is now forked by default.
- JUnit 5: Spring Boot v2.2.1 provides JUnit 5 by default. JUnit 5's vintage engine is also included by default that supports existing JUnit 4-based test classes. We can also use JUnit 4 and JUnit 5 based test classes in the same module.
- AssertJ 3.12: This release of Spring Boot upgrades to AssertJ 3.12. It contains breaking API changes for assertions related to Iterator.
- Hibernate Dialect: In the newer version of Spring Boot, Hibernate chose the dialect to use rather than applying a default dialect based on the detected database.
- Gradle Requirements: The latest version of Spring Boot requires Gradle 4.10.
Frequently Asked Questions (FAQs)
What is Spring?
The Spring framework is one of the most popular application development frameworks of Java. The important feature of the spring framework is dependency injection or the Inversion of Control.
What is Spring Boot?
Spring Boot is one of the modules of the Spring Framework. It helps us to build a stand-alone application with very minimal or almost zero configurations.
Does the Spring Boot 2.2 version support Java13?
The Spring Boot 2.2.1 version now also supports the latest version of Java that is Java 13.
Key Takeaways
In this article, we learnt about the new Spring Boot version. We also saw the new features available in the Spring Boot 2.0 version. We also learned about the essential performance improvements achieved in the Spring Boot 2.0 version.
Recommended Readings:
Apart from this, you can also expand your knowledge by referring to these articles on Java and Web development.
Happy Learning!