Spring Boot 3 🔥 | Feature Breakdown | Breaking Changes | New Changes | Part 1
Summary
TLDRThis video discusses the upgrade from Spring Boot 2 to 3, highlighting challenges, breaking changes, new features, and improvements. It covers the correlation between Java versions and Spring frameworks, the necessity of upgrading to Java 17 and Spring Framework 6, and the impacts on third-party dependencies. The video also demonstrates using GraalVM for faster startup times and outlines changes in property loading, deprecated libraries, and security updates. Additionally, it previews new features like improved micrometer API, Prometheus integration, and enhancements in log4j2 and Elasticsearch support.
Takeaways
- 🚀 Spring Boot 3 was released with significant changes, including the requirement of Java 17 and Spring Framework 6.
- 🔗 The correlation between Java and Spring Framework versions is crucial when upgrading Spring Boot, as seen from the initial Java 1.6 and Spring 4.0 to Java 17 and Spring 6 in Spring Boot 3.
- 📈 Spring Boot 3 focuses on improvements such as faster boot times and ahead-of-time compilation, which are part of its new advancements.
- 🛠️ Upgrading to Spring Boot 3 involves addressing breaking changes, including mandatory upgrades to Java 17 and Spring Framework 6, and dealing with third-party library compatibility.
- 📚 The official release notes for Spring Boot 3 highlight Java 17 as the baseline, the requirement of GraalVM 22.3 for native image support, and updates to Spring Security and Jakarta EE.
- 🔧 Spring Boot 3 introduces new features and deprecations, with the removal of deprecated libraries and changes to auto-configuration and property loading.
- 🔄 The transition from Spring Boot 2 to 3 requires careful consideration of library upgrades, especially for those dependent on Java EE packages that have moved to Jakarta EE.
- 📉 Deprecation of certain features in Spring Boot 3, such as the removal of 'spring.config.use-legacy-processing', may affect applications using specific configurations.
- 🌐 GraalVM support in Spring Boot 3 is a notable feature, enabling the creation of native images for faster startup times and improved performance.
- 📈 Other new features in Spring Boot 3 include upgrades to Micrometer APIs, improvements in Log4j2, and better integration with Prometheus for monitoring.
- 🗓️ The video script also mentions upcoming discussions on support end dates for different Spring Boot versions and the implications for developers.
Q & A
What are the main topics covered in the video script about Spring Boot 3?
-The script covers the release of Spring Boot 3, its correlation with Java and Spring Framework versions, the challenges faced during the upgrade from Spring Boot 1 or 2 to 3, and a detailed look at the new features, improvements, breaking changes, and deprecations in Spring Boot 3.
Why was Spring Boot created and what is its initial version?
-Spring Boot was created on top of Java and the Spring Framework to simplify the bootstrapping and development of new Spring applications. Its initial version, launched in April 2014, was 1.0.0, using Java 1.6 and Spring Framework 4.0 plus.
What are the major Java and Spring Framework version jumps with Spring Boot 3?
-Spring Boot 3 introduced a significant leap in JDK versions, moving to JDK 17, and also upgraded to Spring Framework 6, which includes improvements in boot-up times and ahead-of-time compilations.
What is the significance of the GraalVM in Spring Boot 3?
-GraalVM is significant in Spring Boot 3 as it supports ahead-of-time compilation, which greatly reduces application startup time. Spring Boot 3 requires GraalVM version 22.3 or later for native image support.
What are the challenges one might face when upgrading from Spring Boot 2 to 3?
-Challenges include the need to upgrade to JDK 17 and Spring Framework 6, potential incompatibilities with third-party libraries that may not support these newer versions, and the need to migrate to Jakarta EE for packages previously using Java EE.
What is the impact of upgrading to Spring Boot 3 on Spring Data JDBC?
-There is a breaking change in Spring Data JDBC where the conditional bean auto-configuration has been altered. Users might need to re-inject beans using auto-configuration if they were using conditional bean injections in Spring Boot 2.4.
What is the default behavior when loading properties in Spring Boot 3.0 with multiple profiles?
-In Spring Boot 3.0, the default behavior when loading properties with multiple profiles is that whatever gets loaded last will be the highest priority, as it uses a HashMap to store values.
What are some of the new features in Spring Boot 3 that could be beneficial for developers?
-New features include improved micrometer API support for easier integration with Prometheus, enhancements in log4j2 for better profile and environment property management, and automatic population of trace IDs in Prometheus for micrometer tracing.
What does the script suggest for identifying deprecated classes or libraries in an existing Spring Boot application?
-The script suggests using compiler arguments such as `-Werror` and `-Xlint:deprecation` with the Maven compiler plugin to identify deprecated classes or libraries and break the build if deprecations are used.
What is the importance of the support end dates mentioned in the script for Spring Boot versions?
-The support end dates are important as they indicate the period during which a particular version of Spring Boot will receive updates and support. Understanding these dates can help in planning upgrades to newer versions.
How does Spring Boot 3 handle the integration of Spring Security?
-Spring Boot 3 has upgraded Spring Security, leading to several changes in how it integrates with the Spring Security library. Developers using Spring Security extensively should look out for specific changes and updates in the upcoming videos mentioned in the script.
Outlines
🚀 Spring Boot 3 Release and Upgrade Challenges
This paragraph discusses the release of Spring Boot 3 and the challenges faced during the upgrade from previous versions. It outlines the agenda for the video, which includes understanding the correlation between Java, Spring Framework, and Spring Boot versions, as well as exploring the new features, improvements, and deprecations in Spring Boot 3. The video aims to provide a feature-level breakdown, highlighting the reasons for Spring Boot 3's creation, the official release notes, and a quick demo on identifying duplicated code or annotations.
🛠️ Breaking Changes and Dependencies in Spring Boot 3 Upgrade
The paragraph focuses on the significant changes and challenges in upgrading to Spring Boot 3, particularly the requirement to upgrade to Java 17 and Spring Framework 6. It discusses the impact on dependent libraries that may not support these newer versions and the need to be cautious with third-party libraries. It also mentions specific breaking changes, such as the removal of support for 'useLegacyProcessing' in property loading and the deprecation of certain libraries, emphasizing the importance of addressing these issues during the upgrade process.
🌟 New Features and GraalVM Support in Spring Boot 3
This paragraph introduces new features in Spring Boot 3, with a particular emphasis on GraalVM native image support. It provides a demonstration of building a GraalVM native image to showcase the benefits of ahead-of-time compilation, which significantly reduces application startup time. The paragraph also briefly mentions other improvements, such as updates to Micrometer APIs, Log4j2, and integration with Prometheus, and touches on the importance of understanding these new features for developers looking to upgrade.
🔍 Upcoming Topics and Community Engagement
The final paragraph wraps up the video by summarizing the topics covered and previewing upcoming content. It mentions plans to discuss further improvements in Spring Boot, deprecations, and support end dates in future videos. The speaker invites viewers to share topics they'd like to see covered and encourages engagement through likes and subscriptions, fostering a sense of community and ongoing dialogue around Spring Boot development.
Mindmap
Keywords
💡Spring Boot
💡Spring Framework
💡Java JDK
💡Breaking Changes
💡New Features
💡Deprecations
💡GraalVM
💡Jakarta EE
💡Spring Data JDBC
💡Micrometer
💡Log4j2
Highlights
Spring Boot 3 has been released, bringing with it a variety of new features, improvements, and breaking changes.
Upgrading from Spring Boot 1 or 2 to version 3 involves challenges due to new advancements and deprecations.
Spring Boot 3 introduces a feature level breakdown, including a correlation between Java, Spring, and Spring Boot Frameworks and libraries.
The creation of Spring Boot 3 is linked to the evolution of Java and Spring Framework versions, starting with Java 1.6 and Spring Framework 4.0.
Spring Boot 3 requires Java JDK 17, marking a significant leap from previous versions which supported Java 8.
Spring Framework 6 is integrated into Spring Boot 3, offering improvements in boot up times and ahead of time compilations.
Spring Boot 3's release notes highlight the Java 17 Baseline and the requirement of GraalVM 22.3 for native image support.
Spring Security and other libraries have been upgraded in Spring Boot 3, impacting security integrations.
Jakarta EE has replaced Java EE, moving package versions from 'java.x' to 'Jakarta.*'.
Log4j2, Micrometer, and Prometheus integrations have been improved in Spring Boot 3 for better observability.
Breaking changes in Spring Boot 3 include mandatory upgrades to Java 17 and Spring Framework 6, affecting dependent libraries.
Spring Data JDBC has seen breaking changes in conditional bean auto-configuration.
Spring Boot 3 removes support for legacy property processing, impacting how properties and YAML files are loaded.
Deprecated libraries have been removed from Spring Boot 3, requiring developers to address deprecations in their code base.
GraalVM support in Spring Boot 3 enables ahead of time compilation, significantly reducing application startup times.
Spring Boot 3's native image support with GraalVM allows for containerized applications to start up in milliseconds.
New and noteworthy features in Spring Boot 3 include improvements in Micrometer APIs, Log4j2, and automatic trace ID population for Prometheus.
Auto-configuration changes in Spring Boot 3 accommodate updates in the Elasticsearch Java client library.
Transcripts
it's been a while since springboard 3
got released if you have already
upgraded do let us know what were some
of the challenges which you faced when
you are upgrading your spring boot
version from two or one to three
if you haven't upgraded then let's look
at the feature level breakdown and
understand what are some of the breaking
changes what are some of the new
advancements features improvements and
also deprecations which happened within
the springboard 3 version this is how
the agenda goes we are going to see this
particular breakdown in two different
sections or two different parts in the
first part we are going to look at why
springboard 3 was even created what is
the correlation between Java spring and
also the spring boot Frameworks and the
libraries
we will look at the official feature
release notes at a high level what did
spring mention in their release notes we
will break down into some of the
breaking changes with respect to
springboard 3.0 and also we will look at
the new and noteworthy features which
spring has added I'll show a quick demo
on how to identify duplicated code or
annotation or a method and also
a new feature with a quick glimpse
of course I cannot show everything in a
particular video but then we will break
down that in the further videos in the
next part we will be looking at
improvements deprecations and also the
support end dates with this let's get
started
[Music]
so why did spring boot even get created
if you look at the history of spring
boot spring boot was created on top of
java and the spring framework
so we have to correlate the versions of
java and spring framework when we are
upgrading or when we are correlating
boot versions
when initially spring boot was launched
it was using the Java version 1.6 it was
also using the spring framework 4.0 plus
so which basically means 4.0 subversions
whatever and spring boot was launched in
April 2014 and they were naming that
version as 1.0.0 that's the initial
Inception of spring Boot and it started
with jdk 1.6 later spring upgraded to
Spring framework 5.0 and also version
Java 8 was introduced and springboard 2
was launched in March 2018. most of us I
believe are using spring Boot 2 and in
fact we are using 2.1 because we
upgraded to Java or the jdk 11 whoever
upgraded to jdk 11 they were able to
easily move to Spring boot 2.1 over had
to stay with Java 8 they stayed with the
spring Boot 2 version if you see the
correlation between the jump between
spring Boot 2 and spring boot 2.1 you
can see that both the spring framework
and the Java version changed a lot
however with spring boot 3 there is a
huge leap in terms of jdk upgrade the
spring framework update as well so Java
has now jumped to Java jdk 17 which is
the long term support version and also
spring framework has been upgraded to
Spring frame box 6 which has a lot of
improvements in terms of boot up times
and ahead of time compilations Etc
so spring boot 3.0 got launched in
November 2022 and it's been pretty solid
in terms of providing features and
faster boot up times compared to its
previous versions however if you
personally asked me what did I find
interesting about spring boot 3 except
for the ahead of time compilation I did
not find it feature heavy but still I
would show you some of the features
which I liked and which I think would be
helpful for the developers and the
community so now let's look at the
official release notes which spring has
released
of course the first and the foremost is
the Java 17 Baseline so spring boot 3.0
is now Baseline with Java 17 which
basically means you cannot run any lower
version less than Java 17 to run the
spring boot version 3.
of course recently they announced Java
20 as well I'm not sure if springboot 3
supports it already but Java 19 is
already supported so if you are already
ahead on time with respect to Java
versions you can still use spring boot
if you are lacking with the Java version
definitely you will have to upgrade the
jdk along with it
in addition to it
spring boot 3 requires gral 22.3 version
or even the latest build to
use the NATO build support and also the
tools around it I'll show a quick demo
in a bit on using crawl VM
it also requires the spring framework
six wheel which we just saw in addition
to it Spring Security also got upgraded
so there will be a lot of changes with
respect to Security in terms of
integrating with this Spring Security
Library so if you are using heavily
Spring Security for your spring boot
application do check out
my upcoming videos with respect to
security changes in addition to it
spring also migrated to the latest
Jakarta EE
so Java ee is duplicated so any package
version which is like Java x dot servlet
got moved to Jakarta solids so that's
what is mentioned in the official
documentation in addition to it there is
mentioned about the gravel VM native
image Support also there are a lot of
improvements with respect to log 4j2
micrometer Prometheus Etc
these all provide seamless integration
within the new spring boot framework or
the version 3.0
now let's look at some of the braking
changes and also the new improvements
which were noteworthy
the first and the foremost breaking
change of course is the Java version if
let's say I'm using Java 11 then there
is no luxury for me to continue using
Java 11 but I am forced to use Java 17
in order to go to the latest version of
spring boot so you will have to upgrade
your Java version to Java 17 right it's
a breaking change
in addition to its spring framework 6
like we mentioned earlier it's again a
breaking change because we need to
upgrade to string version 6. now the
challenge with respect to upgrading jdk
and the spring framework is the
dependent libraries there are a lot of
dependent libraries which may not be
supporting Java 17 and the spring
Frameworks so if you are having a
application which has a lot of
third-party dependencies or maybe like
Downstream dependencies you have jars
from some other team some other
application created it some other
libraries getting integrated then just
be cautious around integrating these
libraries because they need to be
supporting Java 17 and also the spring
framework 6 and in addition to it they
also should be using Jakarta ee if you
have package version such as Java x dot
server then you might end up in issue
something like these right Jetty for
example if let's say you're not using
Tomcat as a web server and if you're
using Jetty then Jetty 11 recently
supported or started supporting Jakarta
servlets the Imports now is going to be
Jakarta dot servlets instead of java x
dot servlets right so lot of libraries
which leverage the Java ee package might
be affected so you might want to upgrade
those as well so just be cautious with
respect to third-party Library upgrades
because majority of the projects will be
failing in this particular phase so you
will have to upgrade the dependent
versions of those libraries as well
one another noticeable thing which I saw
was with respect to Spring data jdbc
there is a breaking change in terms of
providing a conditional beam Auto
configuration compared to what we used
to do earlier so it's a minor change but
still if you're using spring data jdbc
then I would just mention it's a
breaking change just take a look at you
might have to just re-inject the beam in
terms of conditional beam injections
using Auto configuration if you were
using springboot 2.4 you know that the
way we load properties and yaml file
configurations into spring config got
changed so in order to retain that we
used a property called Spring config use
Legacy processing that support has been
dropped now with springboot 3.0 so let's
say you had application.properties and
also application.yaml then with respect
to Spring boot application loader there
was a change in Spring boot 2.4 and
above where we were loading everything
into a hash map so spring boot was
loading everything into a hash map and
whatever gets loaded last will be the
highest price ready right and if you
didn't want that kind of an off option
let's say you were using a lot of
profiles and you didn't want to load the
last profile first right in that case we
used to use this configuration called as
use Legacy processing if you are using
this that support has been removed from
springboot 3.0 so just be mindful that
it's a breaking change in terms of
loading properties when you are using
different profiles the last one used to
get loaded so that's the default now so
don't be surprised if some property got
changed if you're using just one
property file which is like either
application or Properties or
application.yaml I don't think you
should have that issue but still be
mindful that there is a priority in
terms of Whatever Gets loaded last will
be the one which gets stored because
it's using hashmap to store the values
and the final one spring boot removed
all the ad deprecated libraries from its
code base right so if let's say I'm
using spring boot version 2.7 uh let me
show you a real-time demo so I have a
project called load trading example
um I recently did a load trading video I
was using springboot 2.7 so this
particular version of the application is
using springboot 2.7 and I want to
identify what are the duplicated
libraries in this particular version so
I want to upgrade to Spring boot 3 but I
also want to make sure I identify what
are the deprecated versions which I'm
using within the code base so for
example I right now don't have any
duplicated version usage so what I did I
added this parameter called as hyphen W
error and then hyphen X lint deprecation
these are two different compiler
arguments which I'm providing to my
Maven compiler plugin so using the maven
compiler plugin I can just now do a May
1 clean compile and this should now help
me in Breaking the build if let's say
there is a deprecation version so I'm
going to use this deprecated class
called as elasticsearch rest Health
indicator so I'll go to the duplicated
example I already wrote the simple
usage right I just use that particular
class and then I am just not doing
anything I'm just assigning null right
now if I recompile this code this code
should break because I'm now using a
duplicated class in my code base notice
that my build failed here saying that
there is a warning and there is a
compilation error because I specify W
error so that means I want to fail my
build if there is a warning in terms of
deprecation so there is a duplication
warning so see here there is a
compilation warning in terms of there is
a duplicated Library so this is one
example how you can identify what
duplicated version of the library's
classes or annotations which you are
using in your current version when you
are upgrading to Spring boot so this is
a very useful way in which you can add
identify breaking changes in terms of
deprecations you shouldn't be surprised
something got removed those are some of
the breaking changes which I found if
you think there is another breaking
change which I missed or anything which
I missed just let me know in the comment
section below others could benefit from
that as well
now coming to the new and the note for
the features the gralvium support is
something which is new uh I have a quick
demo for that as well uh in order to use
this I'm going to use the Graal VM jdk
version 22.3 you cannot use the open jdk
version that doesn't work you will have
to use the gravel VM version to support
it so I have a Docker I'm using Rancher
desktop running so Docker is running as
well right
um so in order to run an image you need
a Docker image obviously you need a
Docker runtime I have Docker you can use
any container runtime now how to build
this particular project is I'm going to
use the command mavenclean package
hyphen P NATO right this particular
project ground demo is using spring boot
3.0.6 which is the latest version of
spring boot as of today I'm using this
particular version now I want to create
a gralvium image I'll show you why
gralium is important in a bit
I'm now converting this particular jar
file whatever gets created into an image
so that it's easy for me to load into a
containerized environment right now let
me run this and you will see the power
of ahead of time compilation which I was
talking about with respect to springboot
3.0 now this particular project is
getting built and you can see that we
are generating an image it's going to
take few minutes and you see the Java
version which I'm using the raw
vm22.3.1 and it's a Community Edition so
I'm just using this particular version
so this is going to generate a gral
image within our Target folder right
I'll show that image in a bit but the
idea of this particular growl images
it's going to compress our jar file into
a format where you can easily start up
the application in seconds or maybe less
than seconds or even in milliseconds
right in this case I don't have any code
in this particular ground demo so I
should be able to start this particular
application in milliseconds but
generally spring boot is famous for
starting up timer I mean it takes a lot
of time even for a Hello World
application right but with gral and over
the period of time in the last few years
springboot has been working in terms of
improving their startup time and it's
very clearly visible with respect to the
new gravvium version and also the spring
boot 3. if you don't know what is graul
VM I have made a separate video on what
is gralvium do take a look at that as
well so the gral image got successfully
built and we can see that the artifacts
are now present in the Target folder let
me go to the Target folder
and you can see that there is a gral
demo which is an image so this
particular project is Graal demo so
earlier we used to run something like
Java hyphen jar and then just that run
the Java application or we just have a
container and then we run that container
right we go to Docker images and then
from there we used to run it now we have
created a grawl image so I can just do a
gral
um
demo and we should be able to spin up
our spring boot application notice that
this particular application came in
almost like 83
milliseconds right it's as fast as
whatever it could get right this is the
power of AD of time compilation so this
is one of the major reasons I would want
to move towards springboot 3.0 because
ahead of time compilation like reduces
the startup time like anything and I can
easily containerize my application with
a gral native support and it provides
lot of improvements in terms of
processing and removing the jet compiler
based approach towards Graal approach
now coming back to our spring boot
features which are new and noteworthy
there are few other features like
um we saw in the previous section
micrometer apis have been upgraded I
don't have a demo to show quickly but
definitely we will do that in the coming
videos there has been a lot of
improvement in the micrometer API
support so you can easily plug
Prometheus into micrometer and you can
get stats out of it in addition to it
the there's also Improvement in the log
4j2
the way we manage profiles environment
properties their lookups and also the
system properties a lot of improvement
has been done with respect to that and
also the Prometheus integration with
micrometer tracing has been improved if
let's say you have micrometer tracing
enabled then the span ID and the trace
ID is automatically populated for
Prometheus so that you can get easily
the trace ID or the traceable
information across your micro Services
when you are in a micro Services setup
so all those are done automatically out
of the box by the latest version of
springboot and of course finally there
are a lot of Auto configuration changes
with respect to the new elasticsearch
Java client Library which elastic
recently updated and again spring boot
supports that these are some of the high
level changes which I thought would be
helpful in terms of
understanding what are the feature level
breakdown and how springboot 3.0 fed in
terms of improving its version for the
betterment of the developer community in
the next video I'm going to show you the
improvements what spring boot has done
the duplications with respect to Spring
boot what are the annotations and the
classes which got deprecated and finally
we will look at what's beyond that what
is the end date what are the support end
dates what is the support indeed for
even the 2.0 versions
um I will be discussing all that in the
next video If let's say you want me to
specifically discuss anything with
respect to Spring boot do let me know
that particular Topic in the comment
section below as always if you like the
video go ahead and like it if you
haven't subscribed to the channel go and
subscribe to it meet you again in the
next video thank you very much
5.0 / 5 (0 votes)