Share E-Book
Scan to open this page

Scan with your phone to open this page

Author: Moises Macero Garcia, Tarun Telang

This book will show you how to build Java-based microservices architecture using the popular Spring Boot framework by evolving a small monolith application to an event-driven architecture composed of several services. This third edition has been updated to cover Spring Boot 3, including its compatibility with Java 17 and Jakarta EE 10, and employs an incremental approach to teach the structure of microservices, test-driven development, and common patterns in distributed systems such as service discovery, load balancing, routing, centralized logs, per-environment configuration, and containerization. Authors Moisés Macero and Tarun Telang get the ball rolling by introducing you to the fundamentals of microservices and Spring Boot before walking you through the development of a basic Spring Boot application. You’ll then see how to build a front end using React, and learn how to use the data layer to read and write data from and to other systems via Spring Boot and its access to Spring Data and its available APIs. Putting together what you've learned thus far, you’ll begin to transform an application from a monolith to a microservice. This pragmatic approach will enable you to better grasp the benefits of using this type of software architecture, instead of keeping you distracted with theoretical concepts. The emphasis is on what matters most, starting with the minimum viable product, while maintaining the ability to adapt and improve your application as needed. After completing this book, you will have the foundational knowledge necessary to build your own microservice-based applications using Spring Boot.

AI Reading Assistant

Whole-book reading guide from stratified index samples; jump to passages in the text

AI guide
【One-Line Pitch】 A hands-on guide that grows a small Spring Boot monolith into an event-driven microservices system, teaching TDD and distributed-systems patterns along the way. Best for Java developers who want practical, incremental exposure to microservices rather than pure theory. 【Book Arc】 - **Opening (~0%–15%)**: Sets up the toolchain and mindset — Java 17, Spring Boot 3, Spring Cloud/Integration/MVC/WebFlux context, and the testing basics (TDD, logging with SLF4J/Logback) you'll use throughout. - **Early (~15%–35%)**: Builds a basic Spring Boot application with a three-tier/three-layer structure, REST APIs, dependency injection, and a minimal React frontend wired to the backend (including CORS handling). - **Middle (~35%–55%)**: Adds the data layer with Spring Data and JPA, refines the domain model, and introduces the reasoning for splitting a monolith into microservices (bounded contexts, Conway's law, deployment independence). - **Late (~55%–80%)**: Moves into distributed-systems concerns — synchronous vs. asynchronous communication, service discovery, load balancing, routing, and the trade-offs of blocking calls between services. - **Ending (~80%–100%)**: Introduces event-driven architecture with a message broker (AMQP/RabbitMQ), covering exchange types, routing, acknowledgments, and Spring AMQP integration. 【Key Takeaways】 - **TDD drives the whole build** (Early): Tests are written before implementation, and Mockito verification is used to assert persistence and service interactions — a habit the book reinforces chapter by chapter. - **Start with a monolith, then evolve** (Middle): The book deliberately builds a working three-tier app first, then refactors toward microservices, so you feel the pain points that justify the split. - **Bounded contexts guide service boundaries** (Middle): Domains are separated to minimize coupling, and Conway's law is used to reason about how team structure should mirror the target architecture. - **Synchronous calls don't scale well across services** (Late): Blocking request chains couple availability; the book pushes you to ask whether you actually need to wait for every downstream step. - **Event-driven design replaces orchestration with choreography** (Ending): Services publish notifications about what happened rather than commanding each other, decoupling producers from consumers. - **A message broker is the backbone of event-driven systems** (Ending): RabbitMQ/AMQP concepts — exchanges, routing, acknowledgments, rejection — are covered as the practical infrastructure for this pattern. - **Spring Boot 3 specifics matter** (Early): Java 17, Jakarta EE 10, and updated Jackson/Hibernate integrations are woven in, so the code matches the current ecosystem rather than older editions. - **Configuration and observability are first-class concerns** (Late): Per-environment configuration, centralized logs, and containerization are treated as part of the architecture, not afterthoughts. 【Reading Tips】 - Deep-read the early chapters on TDD and the three-tier structure — later refactoring only makes sense if you understand the baseline app. - Skim the React frontend chapter if you're backend-focused; the key takeaway is how the frontend talks to the API and handles CORS, not React internals. - Treat the monolith-to-microservices transition (Middle) as the conceptual hinge — pause there and map the bounded contexts onto your own domain. - The event-driven chapters (Ending) are the hardest; read them with the RabbitMQ setup running so exchange/routing concepts stay concrete. - Keep the GitHub chapter repositories open alongside the text; the incremental code changes are easier to follow by diffing than by reading listings. 【Coverage Limits】 The excerpts are heavily fragmented (many OCR artifacts and table-of-contents fragments), so some chapter-level detail — particularly exact chapter titles and the full depth of the event-driven and containerization material — is not fully represented here.
Page 16
59 Presentation Layer 64 REST 64 REST APIs with Spring Boot 65 Designing the APIs 66 257 AMQP and RabbitMQ 259 Overall Description 259 Exchange Types and Rou...
View in text
Excerpt 2
plication-annotation). You’ll learn about this class later. – Within the resources folder are two empty subfolders: static and tem- plates. You can safely de...
View in text
Excerpt 3
properties, and the component’s state (in case it’s needed). In ChallengeComponent, you create a state to hold the retrieved challenge and the data the user...
View in text
Excerpt 4
e is a problem with one of these pieces, the team that owns that microservice can be the one fixing it. With a monolith, it’s usually harder to draw Chapter...
View in text
Excerpt 5
the payload, the subscribers don’t need to change anything. JSON is not the only standard supported by Spring AMQP message converters. You can also use XML o...
View in text
Excerpt 6
g configuration: Instead of using explicit hosts and ports, switch to service names with a URL pattern that also enables load balancing. 358 Chapter 8 Common...
View in text
Excerpt 7
folder in the image (COPY). The third instruction, WORKDIR, changes the working directory of the image to this newly created folder. The EXPOSE command infor...
View in text
Excerpt 8
cks Running Your System in Docker Dockerizing Microservices Dockerizing the UI Dockerizing the Configuration Importer Docker Compose Scaling Up the System wi...
View in text
Tags
AI categories
MicroservicesSpring Boot
ISBN: 1484297571
Publisher: Apress
Publish Year: 2023
Language: English
File Format: PDF
File Size: 8.2 MB
Text Preview (First 20 pages)
Registered users can read the full content for free

Register as a Gaohf Library member to read the complete e-book online for free and enjoy a better reading experience.

Generating text preview…