𝔖 Scriptorium
✦   LIBER   ✦

📁

Spring Boot 3.0 Cookbook: Proven recipes for building modern and robust Java web applications with Spring Boot

✍ Scribed by Felip Miguel Puig


Publisher
Packt Publishing Pvt Ltd
Year
2024
Tongue
English
Leaves
551
Category
Library

⬇  Acquire This Volume

No coin nor oath required. For personal study only.

✦ Synopsis


Tackle the complexities of modern web applications by understanding the uses of Spring Boot's cloud design patterns to build scalable and resilient applications

Key Features
- Discover practical recipes for real cloud-scale application challenges
- Explore what Spring Boot offers to make your application production ready
- Monitor applications, identify bottlenecks, and optimize performance

Book Description
In today's dynamic landscape, crafting robust and scalable Java web applications presents formidable challenges. Spring Boot emerges as the leading framework for web and microservices development, featuring a dynamic ecosystem and seamless integrations to address a spectrum of scenarios, from scaling apps on the cloud to deploying them to production. In this book, you'll explore its streamlined, convention-over-configuration approach, simplifying application development.

You'll start by covering recipes showcasing Spring Boot's features. As you progress, you'll understand how it helps streamline application development while staying ahead of technology trends. The book helps you grasp concepts effectively, explores basic REST APIs, shows you how to escalate to advanced scenarios, and tackle common cloud application challenges like security, scalability, performance optimization, and automated deployments. Dedicated sections are designed to help you stay ahead of the curve with recipes that delve into the latest trends such as containers, observability, native images, DevOps, test automation, and microservices, ensuring your applications align with evolving industry standards.

By the end of this book, you'll be able to build and automate the deployment of a scalable and high-performing distributed solution using Spring Boot 3.

What You Will Learn
- Develop production-grade distributed applications
- Use various data repositories, including relational and NoSQL databases
- Implement modern testing techniques across different levels of application development
- Leveraging Testcontainers to validate all integration scenarios
- Integrate with services like Redis, PostgreSQL, MongoDB, and RabbitMQ
- Authenticate through OpenID providers
- Facilitate smooth migration from earlier Spring Boot versions

Who this book is for
This book is for Java developers who want to gain expertise in modern web development, architects designing complex systems, experienced Spring Boot developers and technology enthusiasts looking to stay up to date with the latest trends, and software engineers in need of practical solutions for everyday challenges. Hands-on experience with Java or Kotlin is required. Prior development experience on the cloud will be useful, but not necessary.

Table of Contents
- Building RESTful APIs
- Securing Spring Boot Applications with OAuth2
- Observability, Monitoring, and Application Management
- Spring Cloud
- Data Persistence and Relational Database Integration with Spring Data
- Data Persistence and NoSQL Database Integration with Spring Data
- Finding Bottlenecks and Optimizing Your Application
- Spring Reactive and Spring Cloud Stream
- Upgrading from Spring Boot 2.x to Spring Boot 3.0

✦ Table of Contents


Spring Boot 3.0 Cookbook
Contributors
About the author
About the reviewers
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Conventions used
Sections
Getting ready
How to do it…
How it works…
There’s more…
See also
Get in touch
Share Your Thoughts
Download a free PDF copy of this book
Part 1:Web Applications and Microservices
1
Building RESTful APIs
Technical requirements
Creating a RESTful API
Getting ready
How to do it...
How it works...
There’s more...
See also
Defining responses and the data model exposed by the API
Getting ready
How to do it...
How it works...
Managing errors in a RESTful API
Getting ready
How to do it...
How it works...
There’s more...
Testing a RESTful API
Getting ready
How to do it...
How it works...
There’s more...
See also
Using OpenAPI to document our RESTful API
Getting ready
How to do it...
How it works...
Consuming a RESTful API from another Spring Boot application using FeignClient
Getting ready
How to do it...
How it works...
There’s more...
Consuming a RESTful API from another Spring Boot application using RestClient
Getting ready
How to do it...
How it works...
Mocking a RESTful API
Getting ready
How to do it...
How it works...
See also
2
Securing Spring Boot Applications with OAuth2
Technical requirements
Setting up Spring Authorization Server
Getting ready
How to do it…
How it works…
There’s more…
See also
Protecting a RESTful API using OAuth2
Getting ready
How to do it…
How it works…
Protecting a RESTful API using OAuth2 with different scopes
Getting ready
How to do it…
How it works…
There’s more…
See also
Configuring an MVC application with OpenID authentication
Getting ready
How to do it…
How it works…
See also
Logging in with Google Accounts
Getting ready
How to do it…
How it works…
See also
Integrating a RESTful API with a cloud IdP
Getting ready
How to do it…
How it works…
There’s more…
3
Observability, Monitoring, and Application Management
Technical requirements
Adding Actuator to your application
Getting ready
How to do it…
How it works…
There’s more…
See also
Creating a custom Actuator endpoint
Getting ready
How to do it…
How it works…
Using probes and creating a custom health check
Getting ready
How to do it…
How it works…
See also
Implementing distributed tracing
Getting ready
How to do it…
How it works…
There’s more…
Accessing standard metrics
Getting ready
How to do it…
How it works…
See also
Creating your own metrics
Getting ready
How to do it…
How it works…
There’s more…
Integrating your application with Prometheus and Grafana
Getting ready
How to do it…
How it works…
Changing the settings of a running application
Getting ready
How to do it…
How it works…
There’s more…
4
Spring Cloud
Technical requirements
Setting up Eureka Server
Getting ready
How to do it...
How it works...
Integrating an application in Eureka Server
Getting ready
How to do it...
How it works...
There’s more...
Scaling out the RESTful API
Getting ready
How to do it...
How it works...
Setting up Spring Cloud Gateway
Getting ready
How to do it...
How it works...
See also
Testing Spring Cloud Gateway
Getting ready
How to do it...
How it works...
Setting up Spring Cloud Config
Getting ready
How to do it...
How it works...
There’s more...
See also
Integrating distributed tracing with Spring Cloud
Getting ready
How to do it...
How it works...
Deploying Spring Boot Admin
Getting ready
How to do it...
How it works...
Protecting Spring Cloud Gateway
Getting ready
How to do it...
How it works...
Part 2: Database Technologies
5
Data Persistence and Relational Database Integration with Spring Data
Technical requirements
Connecting your application to PostgreSQL
Getting ready
How to do it...
How it works...
There’s more...
Using JdbcClient to access the database
Getting ready
How to do it...
How it works...
Using an ORM to access the database
Getting ready
How to do it...
How it works...
There’s more...
See also
Creating the database schema from our code
Getting ready
How to do it...
How it works...
There’s more...
See also
PostgreSQL integration tests with Testcontainers
Getting ready
How to do it...
How it works...
Versioning and upgrading database schema
Getting ready
How to do it...
How it works...
There’s more...
See also
Using JPQL
Getting ready
How to do it...
How it works...
There’s more...
Using Native Queries
Getting ready
How to do it...
How it works...
There’s more...
See also
Updating Operations
Getting ready
How to do it...
How it works...
See also
Using Dynamic Queries
Getting ready
How to do it...
How it works...
There’s more...
See also
Using Transactions
Getting ready
How to do it...
How it works...
There’s more...
See also
6
Data Persistence and NoSQL Database Integration with Spring Data
Technical requirements
Connecting your application to MongoDB
Getting ready
How to do it...
How it works...
There’s more...
Using Testcontainers with MongoDB
Getting ready
How to do it...
How it works...
Data indexing and sharding in MongoDB
Getting ready
How to do it...
How it works...
There’s more...
Using transactions in MongoDB
Getting ready
How to do it...
How it works...
See also
Deploying a MongoDB cluster in Testcontainers
Getting ready
How to do it...
How it works...
Managing concurrency with MongoDB
Getting ready
How to do it...
How it works...
Connecting your application to Apache Cassandra
Getting ready
How to do it...
How it works...
See also
Using Testcontainers with Cassandra
Getting ready
How to do it...
How it works...
Using Apache Cassandra templates
Getting ready
How to do it...
How it works...
There’s more...
Managing concurrency with Apache Cassandra
Getting ready
How to do it...
How it works...
Part 3: Application Optimization
7
Finding Bottlenecks and Optimizing Your Application
Technical requirements
Tuning the database connection pool
Getting ready
How to do it…
How it works…
There’s more…
Caching dependencies
Getting ready
How to do it…
How it works…
There’s more…
Using shared cache
Getting ready
How to do it…
How it works…
Using Testcontainers with Redis cache
Getting ready
How to do it…
How it works…
Creating a native image using Spring Boot
Getting ready
How to do it…
How it works…
Using GraalVM Tracing Agent to configure the native application
Getting ready
How to do it…
How it works…
There’s more…
Creating a native executable using Spring Boot
Getting ready
How to do it…
How it works…
There’s more…
Creating a native executable from a JAR
Getting ready
How to do it…
How it works…
8
Spring Reactive and Spring Cloud Stream
Technical requirements
Creating a reactive RESTful API
Getting ready
How to do it...
How it works...
There’s more...
Using a reactive API client
Getting ready
How to do it...
How it works...
Testing reactive applications
Getting ready
How to do it...
How it works...
Connecting to PostgreSQL using Spring Data R2DBC
Getting ready
How to do it...
How it works...
There’s more...
Event-driven applications with Spring Cloud Stream and RabbitMQ
Getting ready
How to do it...
How it works...
There’s more...
See also
Routing messages with Spring Cloud Stream and RabbitMQ
Getting ready
How to do it...
How it works...
See also
Error handling with Spring Cloud Stream
Getting ready
How to do it...
How it works...
See also
Part 4: Upgrading to Spring Boot 3 from Previous Versions
9
Upgrading from Spring Boot 2.x to Spring Boot 3.0
Technical requirements
Preparing the application
Getting ready
How to do it...
How it works...
See also
Preparing Spring Security
Getting ready
How to do it...
How it works...
See also
Detecting property changes
Getting ready
How to do it...
How it works...
Upgrade the project to Spring Boot 3
Getting ready
How to do it...
How it works...
Upgrading Spring Data
Getting ready
How to do it...
How it works...
There’s more...
See also
Managing Actuator changes
Getting ready
How to do it...
How it works...
See also
Managing web application changes
Getting ready
How to do it...
How it works...
There’s more...
See also
Using OpenRewrite for migration automation
Getting ready
How to do it...
How it works...
There’s more...
See also
Index
Why subscribe?
Other Books You May Enjoy
Packt is searching for authors like you
Download a free PDF copy of this book


📜 SIMILAR VOLUMES


Spring MVC Cookbook: Over 40 recipes for
✍ Alex Bretet 📂 Library 📅 2016 🏛 Packt Publishing 🌐 English

Spring MVC is a lightweight application framework that comes with a great configuration by default. Being part of the Spring Framework, it naturally extended and supported it with an amazing set of recognizable annotations. External libraries can be plugged in and plugged out. It also possesses a re

Full Stack Development with Spring Boot
✍ Juha Hinkula 📂 Library 📅 2023 🏛 Packt Publishing 🌐 English

<p><span>Get up and running with the Spring Boot and React stack – build an app from start to finish, test the frontend and backend, and deploy. Now with TypeScript code!</span></p><p><span>Purchase of the print or Kindle book includes a free PDF eBook</span></p><h4><span>Key Features</span></h4><ul

Kotlin Programming Cookbook: Explore mor
✍ Aanand Shekhar Roy, Rashi Karanpuria 📂 Library 📅 2018 🏛 Packt Publishing - ebooks Account 🌐 English

<p><b>Discover Android programming and web development by understanding the concepts of Kotlin Programming</b></p><h4>Key Features</h4><ul><li>Practical solutions to your common programming problems with Kotlin 1.1</li><li>Leverage the functional power of Kotlin to ease your Android application deve

Kotlin Programming Cookbook: Explore mor
✍ Aanand Shekhar Roy, Rashi Karanpuria 📂 Library 📅 2018 🏛 Packt Publishing 🌐 English

<p><b>Discover Android programming and web development by understanding the concepts of Kotlin Programming</b></p><h4>Key Features</h4><ul><li>Practical solutions to your common programming problems with Kotlin 1.1</li><li>Leverage the functional power of Kotlin to ease your Android application deve

Kotlin Programming Cookbook: Explore mor
✍ Karanpuria, Rashi;Roy, Aanand Shekhar 📂 Library 📅 2018 🏛 Packt Publishing 🌐 English

Discover Android programming and web development by understanding the concepts of Kotlin ProgrammingKey Features Practical solutions to your common programming problems with Kotlin 1.1 Leverage the functional power of Kotlin to ease your Android application development Learn to use Java code in conj