Spring Boot in Practice
Go beyond the basics with Spring Boot! This practical guide presents dozens of relevant scenarios in a convenient problem-solution-discussion format.

In Spring Boot in Practice you will learn:

Spring Boot’s features from an expert’s perspective
Configuring, logging, and monitoring Spring Boot applications
Effective methods for database communication
Utilizing Spring Security and securing your Spring application in production
Designing and developing microservices and RESTful APIs with Spring Boot
Microservice versioning, documentation, and security
Reactive application development and reactive data access with WebSocket and RSocket
Deploying Spring Boot applications on Kubernetes and major cloud platforms
Implementing containerization in a Spring Boot application
Using Spring Boot with Kotlin and GraalVM

Spring Boot in Practice is full of practical recipes for common development problems in Spring Boot. Author Somnath Musib has spent years building applications with Spring, and he shares that extensive experience in this focused guide. You’ll master techniques for using Spring Data, Spring Security, and other Spring-centric solutions. Learn how to work with Spring Boot and Kotlin, handling connections for multiple platforms, and how Spring Boot can simplify building microservices and APIs. Each recipe is built around a real-world problem, complete with a full solution and thoughtful discussion.

Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

About the technology
With Spring Boot, it’s a snap to create standalone Spring applications that require minimal manual setup. Spring Boot directly embeds a server like Tomcat or Jetty into your project and preconfigures core Spring settings, third-party libraries, security, and other key elements. It’s a big framework, with lots of powerful features. This book provides a rich collection of techniques to help you get the most out of Spring Boot.

About the book
Spring Boot in Practice is a cookbook-style guide to Spring application development. Following a convenient Problem-Solution-Discussion format, it takes you technique-by-technique through Spring Boot fundamentals. You’ll dive deep into auto-configuration, security, microservices, and more. Along the way, you’ll also discover numerous advanced and hidden features. All the book’s source code is open source, so you can integrate the detailed samples into your own projects.

What's inside

Instantly useful techniques with reusable source code
Configuring, logging, and monitoring Spring Boot applications
Effective methods for database communication
Securing Spring applications in production
Microservices and RESTful APIs

About the reader
For Spring Boot beginners with some Spring experience.

About the author
Somnath Musib has over a decade of development experience, and has been actively working with Spring Boot since 2015.

Table of Contents
PART 1
1 Booting Spring Boot
PART 2
2 Common Spring Boot tasks
3 Database access with Spring Data
4 Spring Boot: Autoconfiguration and Actuator
5 Securing Spring Boot applications
6 Implementing additional security with Spring Security
7 Developing RESTful Web services with Spring Boot
PART 3
8 Reactive Spring Boot application development
PART 4
9 Deploying Spring Boot applications
PART 5
10 Spring Boot with Kotlin, Native Image, and GraphQL
1140101074
Spring Boot in Practice
Go beyond the basics with Spring Boot! This practical guide presents dozens of relevant scenarios in a convenient problem-solution-discussion format.

In Spring Boot in Practice you will learn:

Spring Boot’s features from an expert’s perspective
Configuring, logging, and monitoring Spring Boot applications
Effective methods for database communication
Utilizing Spring Security and securing your Spring application in production
Designing and developing microservices and RESTful APIs with Spring Boot
Microservice versioning, documentation, and security
Reactive application development and reactive data access with WebSocket and RSocket
Deploying Spring Boot applications on Kubernetes and major cloud platforms
Implementing containerization in a Spring Boot application
Using Spring Boot with Kotlin and GraalVM

Spring Boot in Practice is full of practical recipes for common development problems in Spring Boot. Author Somnath Musib has spent years building applications with Spring, and he shares that extensive experience in this focused guide. You’ll master techniques for using Spring Data, Spring Security, and other Spring-centric solutions. Learn how to work with Spring Boot and Kotlin, handling connections for multiple platforms, and how Spring Boot can simplify building microservices and APIs. Each recipe is built around a real-world problem, complete with a full solution and thoughtful discussion.

Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

About the technology
With Spring Boot, it’s a snap to create standalone Spring applications that require minimal manual setup. Spring Boot directly embeds a server like Tomcat or Jetty into your project and preconfigures core Spring settings, third-party libraries, security, and other key elements. It’s a big framework, with lots of powerful features. This book provides a rich collection of techniques to help you get the most out of Spring Boot.

About the book
Spring Boot in Practice is a cookbook-style guide to Spring application development. Following a convenient Problem-Solution-Discussion format, it takes you technique-by-technique through Spring Boot fundamentals. You’ll dive deep into auto-configuration, security, microservices, and more. Along the way, you’ll also discover numerous advanced and hidden features. All the book’s source code is open source, so you can integrate the detailed samples into your own projects.

What's inside

Instantly useful techniques with reusable source code
Configuring, logging, and monitoring Spring Boot applications
Effective methods for database communication
Securing Spring applications in production
Microservices and RESTful APIs

About the reader
For Spring Boot beginners with some Spring experience.

About the author
Somnath Musib has over a decade of development experience, and has been actively working with Spring Boot since 2015.

Table of Contents
PART 1
1 Booting Spring Boot
PART 2
2 Common Spring Boot tasks
3 Database access with Spring Data
4 Spring Boot: Autoconfiguration and Actuator
5 Securing Spring Boot applications
6 Implementing additional security with Spring Security
7 Developing RESTful Web services with Spring Boot
PART 3
8 Reactive Spring Boot application development
PART 4
9 Deploying Spring Boot applications
PART 5
10 Spring Boot with Kotlin, Native Image, and GraphQL
59.99 In Stock
Spring Boot in Practice

Spring Boot in Practice

by Somnath Musib
Spring Boot in Practice

Spring Boot in Practice

by Somnath Musib

Paperback

$59.99 
  • SHIP THIS ITEM
    In stock. Ships in 6-10 days.
  • PICK UP IN STORE

    Your local store may have stock of this item.

Related collections and offers


Overview

Go beyond the basics with Spring Boot! This practical guide presents dozens of relevant scenarios in a convenient problem-solution-discussion format.

In Spring Boot in Practice you will learn:

Spring Boot’s features from an expert’s perspective
Configuring, logging, and monitoring Spring Boot applications
Effective methods for database communication
Utilizing Spring Security and securing your Spring application in production
Designing and developing microservices and RESTful APIs with Spring Boot
Microservice versioning, documentation, and security
Reactive application development and reactive data access with WebSocket and RSocket
Deploying Spring Boot applications on Kubernetes and major cloud platforms
Implementing containerization in a Spring Boot application
Using Spring Boot with Kotlin and GraalVM

Spring Boot in Practice is full of practical recipes for common development problems in Spring Boot. Author Somnath Musib has spent years building applications with Spring, and he shares that extensive experience in this focused guide. You’ll master techniques for using Spring Data, Spring Security, and other Spring-centric solutions. Learn how to work with Spring Boot and Kotlin, handling connections for multiple platforms, and how Spring Boot can simplify building microservices and APIs. Each recipe is built around a real-world problem, complete with a full solution and thoughtful discussion.

Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.

About the technology
With Spring Boot, it’s a snap to create standalone Spring applications that require minimal manual setup. Spring Boot directly embeds a server like Tomcat or Jetty into your project and preconfigures core Spring settings, third-party libraries, security, and other key elements. It’s a big framework, with lots of powerful features. This book provides a rich collection of techniques to help you get the most out of Spring Boot.

About the book
Spring Boot in Practice is a cookbook-style guide to Spring application development. Following a convenient Problem-Solution-Discussion format, it takes you technique-by-technique through Spring Boot fundamentals. You’ll dive deep into auto-configuration, security, microservices, and more. Along the way, you’ll also discover numerous advanced and hidden features. All the book’s source code is open source, so you can integrate the detailed samples into your own projects.

What's inside

Instantly useful techniques with reusable source code
Configuring, logging, and monitoring Spring Boot applications
Effective methods for database communication
Securing Spring applications in production
Microservices and RESTful APIs

About the reader
For Spring Boot beginners with some Spring experience.

About the author
Somnath Musib has over a decade of development experience, and has been actively working with Spring Boot since 2015.

Table of Contents
PART 1
1 Booting Spring Boot
PART 2
2 Common Spring Boot tasks
3 Database access with Spring Data
4 Spring Boot: Autoconfiguration and Actuator
5 Securing Spring Boot applications
6 Implementing additional security with Spring Security
7 Developing RESTful Web services with Spring Boot
PART 3
8 Reactive Spring Boot application development
PART 4
9 Deploying Spring Boot applications
PART 5
10 Spring Boot with Kotlin, Native Image, and GraphQL

Product Details

ISBN-13: 9781617298813
Publisher: Manning
Publication date: 07/12/2022
Pages: 584
Product dimensions: 7.38(w) x 9.25(h) x 1.30(d)

About the Author

Somnath Musib is an Oracle Certified Java Professional and Oracle Certified Associate, with a decade of experience working with Spring.

Table of Contents

Foreword xiii

Preface xv

Acknowledgments xvii

About this book xix

About the author xxii

About the cover illustration xxiii

Part 1 1

1 Booting Spring Boot 3

1.1 Introducing Spring Boot 4

Why Spring Boot? 4

What is Spring Boot? 5

Spring Boot core features 6

Spring Boot components 7

1.2 Code examples 9

Maven vs. Cradle 9

Java vs. Kotlin 9

Database support 9

Lombok 9

1.3 Getting started with Spring Boot 10

Your first Spring Boot project 10

Spring Boot project structure 10

Creating an executable JAR file 20

Exploring the JAR file 20

Shutting down a Spring Boot application 21

1.4 Spring Boot additional concepts 22

Spring Boot startup events 22

Listening events in a Spring Boot application 23

Custom Spying Boot starters 25

Custom autoconfiguration 26

Failure analyzers 26

Spring Boot actuator 26

Spring Boot developer tool 27

Part 2 29

2 Common Spring Boot tasks 31

2.1 Managing configurations 32

Using the SpringApplication class 32

Using @PropertySource 33

Config data file 35

OS environment variable 38

2.2 Creating custom properties with @Configuration Properties 40

Technique: Defining custom properties with @ConfigurationProperties in a Spring Boot application 41

2.3 Executing code on Spring Boot application startup 46

Technique: Using CommandLineRunner to execute code at Spring Boot application startup 46

2.4 Customizing logging in a Spring Boot application 51

Technique: Understanding and customizing default Spring Boot logging in a Spring Boot application 52

Technique: Using Log4j2 to configure logging in a Spring Boot application 56

2.5 Validate user data using Bean Validation 60

Technique: Using built-in Bean Validation annotations to validate business entity in a Spring Boot application 60

Technique: Defining and using custom Bean Validation annotation to validate a POJO in a Spring Boot application 63

3 Database access with Spring Data 70

3.1 Introducing Spring Data 71

Why Spring Data? 72

Spring Data modules 72

3.2 Configuring a database in a Spring Boot application 74

Technique: Configuring a relational database in a Spring Boot application 74

Technique: Configuring MongoDB database in a Spring Boot application 79

Technique: Initializing a relational database schema with a Spring Boot application 82

3.3 Understanding the CrudRepository interface 86

Technique: Managing domain objects in a relational database with Spring Data JPA 88

Technique: Creating a custom Spring Data repository with Spring Data JPA to manage domain objects in a relational database 94

3.4 Retrieve data from a database using Spring Data 97

Defining query methods 97

Technique: Defining custom query methods to retrieve domain objects from a relational database with Spring Data JPA 98

Implementing pagination with PagingAndSortingRepository 101

Technique: Using PagingAndSortingRepository interface to paginate and sort the data 101

Specifying query using @NamedQuery 104

Technique: Using a named query to manage domain objects in a relational database with Spring Data JPA 105

3.5 Specifying query using @Query 107

Technique: Using @Query annotation to define queries and retrieve domain objects in a relational database with Spring Data JPA 107

3.6 Using Criteria API with Spring Data JPA 111

Technique: Using Criteria API to manage domain objects in a relational database with Spring Data JPA 111

3.7 Using QueryDSL with Spring Data JPA 114

Technique: Using QueryDSL to manage domain objects in a relational database with Spring Data JPA 114

3.8 Managing domain object relationships 119

Technique: Managing domain objects with many-to-many relationships in a relational database with Spring Data JPA 121

4 Spring Boot: Autoconfiguration and Actuator 131

4.1 Understanding Spring Boot autoconfiguration 132

Understanding @Conditional annotation 134

Deep dive into autoconfiguration 136

4.2 Using Spring Boot DevTools 139

Property defaults 139

Automatic restart 140

Live reload 140

4.3 Creating a custom failure analyzer 140

Technique: Creating a custom Spring Boot Failure Analyzer 141

4.4 Spring Boot Actuator 144

Technique: Configuring Spring Boot Actuator in a Spring Boot application 145

Understanding Spring Boot Actuator end-points 146

Managing Spring Boot Actuator endpoints 149

Health endpoint deep dive 150

Creating a custom Spring Boot HealthIndicator 154

Technique: Defining a custom Spring Boot actuator HealthIndicator 155

4.5 Info endpoint deep dive 158

Technique: Configuring info Spring Boot Actuator endpoint 158

Technique: Configuring a custom info contributor to provide custom application info in the Spring Boot Actuator endpoint 162

4.6 Creating a custom Spring Boot Actuator endpoint 164

Technique: Creating a custom Spring Boot actuator endpoint 164

Spring Boot actuator metrics 170

Creating custom metrics 174

Gauge 176

Metrics dashboard with Prometheus and Grafana 179

5 Securing Spring Boot applications 184

5.1 Introducing Spring Security 185

5.2 Hello Spring Security with Spring Boot 187

Technique: Enabling application security with Spring Security in a Spring Boot application 187

Filter, FilterChain, and Spring Security 192

Spring Security architecture 195

Authenticating a user 197

Spring Security autoconfiguration 200

5.3 Using Spring Security 202

Technique: Customizing the default Spring Security login page of a Spring Boot application 202

Technique: Configuring in-memory authentication with custom users in Spring Security in a Spring Boot application 207

Technique: Configuring JDBC authentication with Spring Security in a Spring Boot application 215

Technique: Implementing JDBC authentication with custom UserDetailsService in a Spring Boot application 219

Technique: Implementing LDAP authentication in a Spring Boot application 224

Technique: Implementing HTTP basic authentication in a Spring Boot application 229

6 Implementing additional security with Spring Security 233

6.1 Enabling HTTPS in a Spring Boot application 235

Technique: Enabling HTTPS in a Spring Boot application 235

6.2 Securing secrets in Spring Cloud Vault 238

Technique: Managing application secrets with HashiCorp Vault in a Spring Boot application 239

6.3 Implementing user registration 242

Technique: Implementing user registration with Spring Security in a Spring Boot application 242

6.4 Implementing email verification at user registration 251

Technique: Validating user email addresses in a Spring Boot application 251

6.5 Controlling multiple incorrect login attempts 261

Technique: Controlling multiple incorrect login attempts in a Spring Boot application 261

6.6 Implementing a Remember Me feature 267

Technique: Enabling a Remember Me feature in a Spring Boot application with Spring Security 268

6.7 Implementing reCAPTCHA 270

Technique: Enabling Google reCAPTCHA in a Spring Boot application with Spring Security 271

6.8 Enabling two-factor authentication with Google Authenticator 276

Technique: Enabling two-factor authentication in a Spring Boot application 276

6.9 Authentication with OAuth2 287

Technique: Enabling sign in with Google in a Spring Boot application 288

6.10 Securing Actuator endpoints 292

Technique: Securing Spring Boot Actuator endpoints 294

Developing RESTful Web services with Spring Boot 297

7.1 Developing a RESTful API with Spring Boot 298

Technique: Developing a RESTful API using Spring Boot 298

7.2 Managing exceptions in a Spring Boot RESTful API 306

Technique: Handling exceptions in a RESTful API 306

7.3 Testing a RESTful API 311

Technique: Testing a RESTful API in a Spring Boot application 311

7.4 Documenting a RESTful API 317

Technique: Documenting a RESTful API with OpenAPI 317

7.5 Implementing RESTful API versioning 323

Technique: Implementing versioning in a RESTful API 324

7.6 Securing a RESTful API 334

Technique: UsingJWT to authorize RESTful API requests 335

Part 3 347

8 Reactive Spring Boot application development 349

8.1 Introduction to reactive programming 350

Backpressure 353

Benefits of reactive programming 354

8.2 Understanding Project Reactor 355

8.3 Introducing Spring WebFlux 358

Technique: Developing a reactive RESTful API with annotated controllers 359

Technique: Developing a reactive RESTful API with functional endpoints 367

8.4 Testing reactive applications 372

Technique: Using WebClient to build an API client 373

8.5 Introduction to RSocket 378

Technique: Developing applications using RSocket and Spring Boot 379

8.6 Introduction to WebSocket 388

Technique: Developing an application using WehSocket and Spring Boot 389

Part 4 397

9 Deploying Spring Boot applications 399

9.1 Running Spring Boot applications as executable JAR files 401

Technique: Packaging and executing a Spring Boot application as an executable JAR file 401

9.2 Deploying Spring Boot applications as WAR in the WildFly application server 406

Technique: Packaging and deploying a Spring Boot application as WAR in the WildFly application server 407

9.3 Deploying Spring Boot applications in Cloud Foundry 416

Technique: Deploying a Spring Boot application to Cloud Foundry 417

9.4 Deploying Spring Boot applications in Heroku 420

Technique: Deploying a Spring Boot application in Heroku 420

9.5 Running Spring Boot applications as Docker containers 423

Technique: Creating a container image and running a Spring Boot application as a container 424

9.6 Deploying Spring Boot applications in a Kubernetes cluster 429

Technique: Deploying a Spring Boot application in a Kubernetes cluster 429

9.7 Deploying Spring Boot applications in Red Hat OpenShift 434

Technique: Deploying a Spring Boot application in the Red Hat OpenShift platform 434

Part 5 439

10 Spring Boot with Kotlin, Native Image, and GraphQL 441

10.1 Spring Boot with Kotlin 442

Technique: Developing a Spring Boot application with Kotlin 443

Technique: Securing a Spring Boot Kotlin application with Spring Security 449

10.2 Introducing Spring Native 453

Introduction to GraalVM 453

GraalVM native image 454

Spring Boot native image 455

Technique: Generating Spring Boot native image using buildpacks 455

Technique: Generating Spring Boot native image using a Maven plugin 460

Understanding Spring AOT Maven Plugin 463

10.3 Spring Boot with GraphQL 464

Issues with REST 464

Introduction to GraphQL 466

Using GraphQL with Spring Boot 467

Technique: Developing a GraphQL API with a Spring Boot application 467

Technique: Developing a GraphQL API over WebSocket with a Spring Boot application 483

Appendix A Generating and building Spring Boot projects 486

Appendix B Spring MVC and Thymeleaf Template Engine 522

Index 549

From the B&N Reads Blog

Customer Reviews