My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

Features of Spring boot 2.0

johnebishop's photo
johnebishop
·Apr 17, 2018

Spring Boot is a rapid application development framework designed to simplify the development of stand-alone, production-grade, Spring-framework-based apps that run with little Spring configuration. Spring Boot is "opinionated" out of the box, so it encourages specific practices to increase ease of development.

Spring Boot 2.0 is a released packed with great stuff. I believe the main arguments for upgrading are:

Java 9 support Better support for reactive applications Thymeleaf 3 support If you benefit from any of this three things, then you should definitely consider upgrading.

Spring boot 2.0 Highlights:

Java 8 baseline, and Java 9 support. In short, what you should know is that Spring Boot 2.0 requires Java 8 as a minimum version. Furthermore, a lot of existing APIs have been updated to take advantage of Java 8 features (including default methods on interfaces, functional callbacks, and new APIs such as javax.time). If you aren’t using Java 8 yet, you should upgrade your JDK before you decide to develop Spring Boot 2.0 applications. The newest Spring Boot version has also been tested with JDK 9 so it’s good to go. All the jars ship with automatic module name entries in the manifests for module system compatibility.

Reactive web programming support with Spring WebFlux/WebFlux.fn. Spring Boot provides auto-configuration for both annotation based Spring WebFlux applications, as well as WebFlux.fn which offers a more functional style API.

Auto-configuration and starter POMs for reactive Spring Data Cassandra, MongoDB, Couchbase, and Redis.

Reactive Spring. A lot of projects in the Spring portfolio are currently offering first-class support for developing reactive applications. Reactive applications (which are now fully asynchronous and non-blocking) are intended for use in an event-loop execution model (instead of the more traditional one thread-per-request execution model). Spring Boot 2.0 fully supports reactive applications via auto-configuration and starter-POMs. The internals of Spring Boot itself have also been updated where necessary to offer reactive alernatives (the most noticeable being the embedded server support).

Support for embedded Netty. WebFlux does not rely on Servlet APIs but the good news is that support for Netty is offered as an embedded server for the first time. The spring-boot-starter-webflux starter POM will pull-in Netty 4.1 and Ractor Netty. HTTP/2 is now provided for Tomcat, Undertow, and Jetty. However, keep in mind that support depends on the chosen web server and the application environment.

Spring Boot’s Gradle plugin has been largely rewritten so now it enables a number of significant improvements. However, you should know that Spring Boot now requires Gradle 4.x so check the migration guide if you’re upgrading a project that uses Gradle. The latest Spring Boot release also includes support for Kotlin 1.2.x and offers a runApplication function which provides a way to run a Spring Boot application using idiomatic Kotlin.

Spring Boot 2.0 now detects the jOOQ dialect automatically based on the DataSource (similarly to what is done for the JPA dialect). A new @JooqTest annotation has also been introduced to ease testing where only jOOQ has to be used. Spring Boot now auto-configures the open-source time series database InfluxDB. To enable InfluxDB support you’ll have to set a spring.influx.url property, and include influxdb-javaon your classpath.

Resources:

spring boot 2.0 features

spring boot official