Spring Boot: Up and Running: Building Cloud Native Java and Kotlin Applications
- Length: 324 pages
- Edition: 1
- Language: English
- Publisher: O'Reilly Media
- Publication Date: 2021-03-02
- ISBN-10: 1492076988
- ISBN-13: 9781492076988
- Sales Rank: #1956452 (See Top 100 Books)
With over 75 million downloads per month, Spring Boot is the most widely used Java framework available. Its ease and power have revolutionized application development from monoliths to microservices. Yet Spring Boot’s simplicity can also be confounding. How do developers learn enough to be productive immediately? This practical book shows you how to use this framework to write successful mission-critical applications.
Mark Heckler from VMware, the company behind Spring, guides you through Spring Boot’s architecture and approach, covering topics such as debugging, testing, and deployment. If you want to develop cloud native Java or Kotlin applications with Spring Boot rapidly and effectively–using reactive programming, building APIs, and creating database access of all kinds–this book is for you.
- Learn how Spring Boot simplifies cloud native application development and deployment
- Build reactive applications and extend communication across the network boundary to create distributed systems
- Understand how Spring Boot’s architecture and approach increases developer productivity and application portability
- Deploy Spring Boot applications for production workloads rapidly and reliably
- Monitor application and system health for optimal performance and reliability
- Debug, test, and secure cloud-based applications painlessly
Preface Welcome Conventions Used in This Book Using Code Examples O’Reilly Online Learning How to Contact Us Acknowledgments 1. Spring Boot in a Nutshell Spring Boot’s Three Foundational Features Starters for Simplified Dependency Management Executable JARs for Simplified Deployment Autoconfiguration Summary 2. Choosing Your Tools and Getting Started Maven or Gradle? Apache Maven Gradle Choosing Between Maven and Gradle Java or Kotlin? Java Kotlin Choosing Between Java and Kotlin Choosing a Version of Spring Boot The Spring Initializr Straight Outta Commandline Staying In Integrated Development Environments (IDEs) Cruising Down main() Summary 3. Creating Your First Spring Boot REST API The Hows and Whys of APIs What Is REST, and Why Does It Matter? Your API, HTTP Verb Style Back to the Initializr Creating a Simple Domain GET-ting @RestController in a Nutshell Let’s GET Busy POST-ing PUT-ting DELETE-ing And More Trust, but Verify Summary 4. Adding Database Access to Your Spring Boot App Priming Autoconfig for Database Access What Do We Hope to Gain? Adding a Database Dependency Adding Code The @Entity The Repository The utility, aka “Springing” into action Saving and Retrieving Data A Bit of Polishing Summary 5. Configuring and Inspecting Your Spring Boot App Application Configuration @Value @ConfigurationProperties Potential Third-Party Option Autoconfiguration Report Actuator Getting Actuator to Open Up Becoming More Environmentally Aware Using Actuator Turning Up the Volume on Logging with Actuator Summary 6. Really Digging into Data Defining Entities Template Support Repository Support @Before Creating a Template-Based Service Using Redis Initializing the Project Developing the Redis Service Defining the domain class Adding template support Bringing it all together The results Converting from Template to Repository Creating a Repository-Based Service Using the Java Persistence API (JPA) Initializing the Project Developing the JPA (MySQL) Service Defining the domain class Creating the repository interface Bringing it all together Polling PlaneFinder Connecting to MariaDB/MySQL The results Loading Data API- or database-specific scripts Creating and populating with scripts Populating the database using the application’s repository Other mechanisms Creating a Repository-Based Service Using a NoSQL Document Database Initializing the Project Developing the MongoDB Service Defining the domain class Creating the repository interface Bringing it all together Polling PlaneFinder The results Creating a Repository-Based Service Using a NoSQL Graph Database Initializing the Project Developing the Neo4j Service Defining the domain class Creating the repository interface Bringing it all together Polling PlaneFinder Connecting to Neo4j The results Summary 7. Creating Applications Using Spring MVC Spring MVC: What Does It Mean? End User Interactions Using Template Engines Initializing the Project Developing the Aircraft Positions Application Defining the domain class Creating the repository interface Working with Model and Controller Creating the requisite View files The results A refreshing flourish Passing Messages Powering Up PlaneFinder Required dependencies Supplying aircraft positions Application properties Extending the Aircraft Positions Application Required dependencies Consuming aircraft positions Application properties Contacting the Controller The results Creating Conversations with WebSocket What Is WebSocket? Refactoring the Aircraft Positions Application Additional dependencies Handling WebSocket connections and messages Broadcasting aircraft positions to WebSocket connections WebSocket in back, WebSocket in front The results Summary 8. Reactive Programming with Project Reactor and Spring WebFlux Introduction to Reactive Programming Project Reactor Tomcat versus Netty Reactive Data Access R2DBC with H2 Updating PlaneFinder Updating the Aircraft Positions application Reactive Thymeleaf RSocket for Fully Reactive Interprocess Communication What Is RSocket? Putting RSocket to Work Migrating PlaneFinder to RSocket Migrating Aircraft Positions to RSocket Summary 9. Testing Spring Boot Applications for Increased Production Readiness Unit Testing Introducing @SpringBootTest Important Unit Tests for the Aircraft Positions Application Refactoring for Better Testing Revisiting the code to isolate behavior Refining the test Testing Slices Summary 10. Securing Your Spring Boot Application Authentication and Authorization Authentication Authorization Spring Security in a Nutshell The HTTP Firewall Security Filter Chains Request and Response Headers Implementing Forms-Based Authentication and Authorization with Spring Security Adding Spring Security Dependencies Adding Authentication Authorization Implementing OpenID Connect and OAuth2 for Authentication and Authorization Aircraft Positions Client Application Adding OpenID Connect and OAuth2 dependencies to Aircraft Positions Refactoring Aircraft Positions for authentication and authorization PlaneFinder Resource Server Adding OpenID Connect and OAuth2 Dependencies to Aircraft Positions Refactoring PlaneFinder for resource authorization Summary 11. Deploying Your Spring Boot Application Revisiting the Spring Boot Executable JAR Building a “Fully Executable” Spring Boot JAR What Does It Mean? Exploding JARs Deploying Spring Boot Applications to Containers Creating a Container Image from an IDE Creating a Container Image from the Command Line Verifying the Image Exists Running the Containerized Application Utilities for Examining Spring Boot Application Container Images Pack Dive Summary 12. Going Deeper with Reactive When Reactive? Testing Reactive Applications But First, Refactoring And Now, the Testing Test for retrieving all aircraft positions Testing Aircraft Positions search capabilities Diagnosing and Debugging Reactive Applications Hooks.onOperatorDebug() Checkpoints ReactorDebugAgent.init() Summary Index
Donate to keep this site alive
How to download source code?
1. Go to: https://www.oreilly.com/
2. Search the book title: Spring Boot: Up and Running: Building Cloud Native Java and Kotlin Applications
, sometime you may not get the results, please search the main title
3. Click the book title in the search results
3. Publisher resources
section, click Download Example Code
.
1. Disable the AdBlock plugin. Otherwise, you may not get any links.
2. Solve the CAPTCHA.
3. Click download link.
4. Lead to download server to download.