Spring Tips: Spring Boot 3.2

Поделиться
HTML-код
  • Опубликовано: 31 янв 2025

Комментарии • 67

  • @umutylmaz7800
    @umutylmaz7800 Год назад +48

    Great video Josh thanks!
    I'm leaving below the topics covered in the video.
    0:00 Introduction
    1:00 Data Oriented Programming
    11:25 Virtual Threads
    28:40 Jdbc & Rest Client
    44:15 Coordinated Restore At Checkpoint
    57:16 Security With SSL
    1:05:10 Observability
    1:21:01 Onward

  • @jamesrooney931
    @jamesrooney931 Год назад +21

    0:01:04 Java 21 & Data Oriented Programming
    0:11:27 Virtual Threads (LOOM)
    0:28:40 JDBC Client & REST Client
    0:44:18 Co-Ordinated Restore at Checkpoint (CRaC)
    0:57:20 Better Security with SSL
    1:05:14 Observability

  • @LukasBradley
    @LukasBradley Год назад +143

    Please use Chapters on your videos. Thanks!

    • @joachimdietl6737
      @joachimdietl6737 Год назад

      like they do in the motorcycle club?

    • @xqdd9214
      @xqdd9214 4 месяца назад

      [00:16] Spring Boot 3.2 brings many new features including support for virtual threads and Project Loom, improved observability support, overloadable SSL support, and more.
      Spring Boot 3.2 brings many new features including virtual threads and Project Loom.
      Java 21 is an important feature of Spring Boot 3.2.
      Java 21 introduces some new syntax changes such as closed types, pattern matching, smart switch expressions, and records.
      Java 21 is called data-oriented programming and aims to improve the performance of Java in large monolithic applications.
      [10:13] It is very convenient to use string formatting and multi-line variables, and there are new features such as pattern matching and deconstruction operators.
      String formatting and multi-line variables are convenient options.
      New features include records, sealed types, smart switch expressions, and pattern matching.
      There is no deconstruction operator yet, but it is under development.
      Project Loom virtual threads are an important feature in Java 21.
      [20:27] In this snippet, we create a collection that skips duplicates and use a thread to log the name of the current thread and sleep for 100 milliseconds.
      We create a collection that skips duplicates.
      We use a thread to log the name of the current thread.
      We sleep for 100 milliseconds.
      We demonstrate the use of virtual threads to execute Java code.
      [30:41] In Spring Boot 3.2, we will use Java 21, Maven, and some supporting libraries to build an application that communicates with a SQL database.
      We use the test containers API to start a Docker image.
      We use the spring boot starter jdbc dependency to connect to the PostgreSQL database.
      We start the PostgreSQL container by adding specific configuration.
      [40:57] Using the declarative interfaces in Spring Boot 3.0, we can simplify the code even more and provide a cat fact for a given URL request.
      We can use the new JDBC and REST clients to call the endpoints.
      Using Project Loom and Drava 21, we can get consistent virtual thread integration in different layers of a Spring application.
      This approach has the convenience of blocking APIs without losing usability.
      You can use declarative interfaces to implement cat facts for a given URL request.
      [51:09] There is an interface in the Spring framework called SmartLifeCycle that can be used to represent the methods of a typical Spring lifecycle.
      SmartLifeCycle is a smarter version for user consumption.
      The methods of SmartLifeCycle correspond to the checkpoint methods.
      You can use SmartLifeCycle to manage the start and stop of an application.
      In this example, by implementing the SmartLifeCycle interface, you can implement the start and stop functionality of the application.
      [01:01:23] A unique key-value pair is generated through a file, and a self-signed SSL certificate is configured.
      Write numbers in a file, increment them each time they run, and write them to the file.
      The generated key-value pairs are unique and are used to show changes over time.
      A self-signed SSL certificate is configured and used by specifying port number 8443.
      [01:11:38] On the local machine, we can use Zipkin to view the distributed tracing graph
      Use Docker compose to start the Zipkin instance
      Increase the sampling probability in the application code
      Use aop to support adding annotations on the classpath to display the trace ID and span ID
      Use Zipkin to view the request log and jumps between services

  • @florianpopa8848
    @florianpopa8848 Год назад +1

    Thank you for sharing this!
    Having worked as a PHP developer for six years until 2018, I've experienced its limitations firsthand.
    Since switching to Java, I've found it to be a significantly better experience.

  • @chandanv89
    @chandanv89 Год назад +7

    Powerful content! Thanks a lot for putting so much effort into creating this demo. Saves us developers a ton of time skimming though all those reference docs and release notes. Good to see Spring getting so many useful and interesting features.

  • @joachimdietl6737
    @joachimdietl6737 Год назад

    Josh you are the best! And of course we want the new JDK request factory, so let'S say new blablabla very good!

  • @kenwang8595
    @kenwang8595 Год назад +1

    Great video! Just in span of one hour, I feel that I have learned so much! Many thanks!

  • @Mateusz-xr9qw
    @Mateusz-xr9qw Год назад

    That was very great start of a day. Awesome video ❤

  • @konstantingromov6485
    @konstantingromov6485 Год назад +6

    Josh talk is great as usual.
    One small thing I've noticed - why @Controller+@ResponseBody but not @RestController in demo examples?

    • @coffeesoftware
      @coffeesoftware Год назад +1

      because what Im doing isn't REST :) it's HTTP with JSON. If I used HATEOAS and hypermedia, then it'd be proper REST. it's also more consistent with RSocket, GraphQL, web sockets, MVC, etc., uses of `@Controller` in the rest of the stack.

  • @arnaudpoutieu1331
    @arnaudpoutieu1331 Год назад +1

    Many thanks for your energy and sharing such passion with us!

  • @bawaparampreet24
    @bawaparampreet24 Год назад +4

    11:27 : Virtual Threads
    28:35 : Jdbc Client & Rest Client

  • @SumitSharma864
    @SumitSharma864 Год назад

    Thanks a lot informative and useful video. Really helpful to understand whats new there before upgrade.

  • @DanbyArg
    @DanbyArg Год назад +2

    Thanks for all of the great content Josh 👍

  • @nagamohank2244
    @nagamohank2244 Год назад

    Thanks! Josh for the Tips

  • @CheeseStickzZ
    @CheeseStickzZ Год назад

    23:56 This made me giggle for a whole hour. I agree Php is the biggest mess in the history of web development

  • @vukotici32
    @vukotici32 Год назад +3

    set('springCloudVersion', "2023.0.0-RC1")
    i am sad to see that the sprng cloud version is not ready for spring boot 3.2
    we can not update

  • @javaspringdev
    @javaspringdev Год назад

    Thanks Josh that's a great video

  • @javisartdesign
    @javisartdesign Год назад

    thaaaaanks! greatest tips ever

  • @Gohel95
    @Gohel95 Год назад +1

    Hey @josh at 36:00 you use @Responsebody and @Controller is there any reason for not using @Restcontroller?

    • @coffeesoftware
      @coffeesoftware Год назад +2

      well spotted ! the reason is because... it's not REST :) I'm not actually using hypermedia and HATEOAS and the like. I'm only at level 2 on Dr. Leonard Richardson's Maturity Model. I got tired of having to juggle that conflict in my head and I embrace the reality: it's just an HTTP + JSON endpoint. Also, Spring has a ton of uses for @Controller. It's just more thematically consistent to use it all over the place. If there was a `@GraphqlController`, and an `@RSocketController`, and an `@MvcController`, etc., then maybe I'd be more inclined.

    • @Gohel95
      @Gohel95 Год назад

      you're a great man @@coffeesoftware. Thank you so much for the explanation.

  • @saintpaulbassanagavi3
    @saintpaulbassanagavi3 Год назад

    Incredible video

  • @DenisKorolevR
    @DenisKorolevR Год назад

    Thank you for your video!
    But it looks like that Sleuth in Spring Boot 2 was easier to work with.

  • @salo.
    @salo. Год назад +1

    Can I use Graal with default JDK 21? OR I should always download and set Special Graal 21 JDK ?

    • @coffeesoftware
      @coffeesoftware Год назад

      you need the special GraalVM (or Liberica NIK) distribution. It's amazing: Java is an open source distribution. GraalVM is a fork of OpenJDK with some extra features. There are many OpenJDK distributions, GraalVM is but one of many. But did you know that GraalVM itself has forks and distributions? Liberica NIK (from BellSoft) is one such distribution.

    • @salo.
      @salo. Год назад

      I can't see the answer, somewhy.

  • @myanch200
    @myanch200 Год назад

    woww Java has changed a lot

  • @asishkumarsatapathy3466
    @asishkumarsatapathy3466 Год назад

    Chapters please sir... Anywau thanks for awesome content!! Cheers 🍻

  • @kennethcarvalho3684
    @kennethcarvalho3684 Год назад +3

    Problem in IT field is information overload. How can mind keep all this information

    • @TaiChiSWAG
      @TaiChiSWAG Год назад

      until one practically apply one of the new features

    • @samiulalomsium-t7i
      @samiulalomsium-t7i Год назад

      Don't be overwhelmed. Instead, you have to decide which core information you must need and most probably learn it from an official doc or book. Because from reading, you have your available time to consume the information in your way. But in video, you have to follow the creator's style of timeline to consume information, which in most cases won't be within your required time demand.

    • @kennethcarvalho3684
      @kennethcarvalho3684 Год назад

      @@samiulalomsium-t7i thanks

  • @chrispure7461
    @chrispure7461 Год назад +1

    oauth2 token/refresh suport for restclient?

  • @avalagum7957
    @avalagum7957 Год назад +3

    Does Spring Boot 3.2 give us a VirtualThreadPerTaskExecutor bean or do we have to create one?

    • @hendisantika
      @hendisantika Год назад

      Like this:
      spring.threads.virtual.enabled = true

    • @avalagum7957
      @avalagum7957 Год назад +1

      @@hendisantika did you really read my question? 🙂

    • @avalagum7957
      @avalagum7957 Год назад +7

      Answer to self: no.There's only 1 bean of type Executor in the Spring application context. When a runnable, which prints out the current thread name, is run by it, it prints out something like task-1.
      The thread used by Tomcat in spring webmvc is a virtual thread (its thread name is like VirtualThread[#73,tomcat-handler-0]/runnable@ForkJoinPool-1-worker-1). That means there's no need to create a VirtualThreadPerTaskExecutor in a spring boot based web app.

  • @MarianSchubert
    @MarianSchubert Год назад

    Thanks!

  • @marcinkunert
    @marcinkunert Год назад

    Is there a way to prevent data.sql / schema.sql being run on restart? Similary to what @RestartScope does.

  • @pouyakhoshkhoo3855
    @pouyakhoshkhoo3855 Год назад

    Thank you

  • @vishnuvs6121
    @vishnuvs6121 Год назад

    Did you use ChatGPT to generate the thumbnail?

  • @hobaca1465
    @hobaca1465 Год назад

    Interesting RUclips thumbnail - String Boot and SSSL... all good, midjourney still has aways to go.

  • @karthiksundaram544
    @karthiksundaram544 8 месяцев назад

  • @WaterOfPanela
    @WaterOfPanela 11 месяцев назад +1

    why is gradle so overlooked?...

  • @rtb8085
    @rtb8085 Год назад

    I think you have a bit of confusion about the meaning of Tuple conceptually: tuple is a pair, and not a container for single element !

  • @lompatin
    @lompatin Год назад

    String boot?

  • @maksimmuruev423
    @maksimmuruev423 Год назад +1

    Testcontainers support is kinda bad.. you have to put those lines for container control in each test suite.. is it even wise? I mean test itself probably should not care about which db connection in use embeddeddb or docker.. also conversion from embedded to testcontainers is painful in this way. I've found a way do it without update each single testsuite but its kinda hack anyway. Will be good if spring boot allow this just setup in separated config file or maybe just one annotation in testconfig..

    • @shelajev
      @shelajev Год назад +1

      Modern Spring Boot does include exactly that. You can declare Testcontainers containers as beans, so their lifecycle is handled automatically, use `@ServiceConnection` annotation to automatically instruct Spring Boot to use the annotated bean as the default datastore or message broker (there's a whole set of supported technologies) so the connection details are handled automatically too. You also can put the container beans in a @TestConfiguration, and instrument your test classes with using that without changing the tests themselves.
      And you can even run the app itself with this configuration, so you get the environment for the development setup. Here's a video where we explored these concepts: ruclips.net/video/7i0C_QWpSn8/видео.html

  • @dimitricharles9784
    @dimitricharles9784 Год назад +1

    Php the 1 trillion dollar mistake 😂😂😂😂😂

  • @CheeseStickzZ
    @CheeseStickzZ Год назад

    I just came here to say I hate reactive programming with a passion, thank the heavens for project loom. Us old school java developers (8 years+) cannot stand the reactive paradigm

  • @CodeJava
    @CodeJava 24 дня назад

    I think this video's thumbnail was created by ChatGPT. But thankfully the video was not :D

  • @karthiksundaram544
    @karthiksundaram544 8 месяцев назад

    😂

  • @shakib_04
    @shakib_04 Год назад

    thumbnail likely generated with AI

  • @KhodeCamp
    @KhodeCamp Год назад +1

    Thank you so much for the tips!

  • @karthiksundaram544
    @karthiksundaram544 8 месяцев назад