Book description
By dividing large applications into separate self-contained units, Microservices are a great step toward reducing complexity and increasing flexibility. Spring Microservices in Action, Second Edition teaches you how to build microservice-based applications using Java and the Spring platform. This second edition is fully updated for the latest version of Spring, with expanded coverage of API routing with Spring Cloud Gateway, logging with the ELK stack, metrics with Prometheus and Grafana, security with the Hashicorp Vault, and modern deployment practices with Kubernetes and Istio.About the Technology
Building and deploying microservices can be easy in Spring! Libraries like Spring Boot, Spring Cloud, and Spring Cloud Gateway reduce the boilerplate code in REST-based services. They provide an effective toolbox to get your microservices up and running on both public and private clouds.
About the Book
Spring Microservices in Action, Second Edition teaches you to build microservice-based applications using Java and Spring. You’ll start by creating basic services, then move to efficient logging and monitoring. Learn to refactor Java applications with Spring’s intuitive tooling, and master API management with Spring Cloud Gateway. You’ll even deploy Spring Cloud applications with AWS and Kubernetes.
What's Inside
- Microservice design principles and best practices
- Configuration with Spring Cloud Config and Hashicorp Vault
- Client-side resiliency with Resilience4j, and Spring Cloud Load Balancer
- Metrics monitoring with Prometheus and Grafana
- Distributed tracing with Spring Cloud Sleuth, Zipkin, and ELK Stack
About the Reader
For experienced Java and Spring developers.
About the Authors
John Carnell is a senior cloud engineer with 20 years of Java experience. Illary Huaylupo Sánchez is a software engineer with over 13 years of experience.
Quotes
A must-have for any professional Spring microservice developer’s bookshelf!
- Iain Campbell, Tango Telecom
A holistic and practical approach to building cloud native microservices using Spring. Loads of practice, advice, and fun.
- Satej Sahu, Honeywell
A perfect reference, whether you are a beginner or an experienced Java developer.
- Philippe Vialatte, Symphony
A great guide on modern secure deployment practices for the cloud.
- Todd Cook, Appen
Publisher resources
Table of contents
- inside front cover
- Spring Microservices in Action
- Copyright
- dedication
- brief contents
- contents
- front matter
-
1 Welcome to the cloud, Spring
- 1.1 The evolution towards a microservices architecture
- 1.2 Microservices with Spring
- 1.3 What are we building?
- 1.4 What is this book about?
- 1.5 Cloud and microservice-based applications
- 1.6 Microservices are more than writing the code
- 1.7 Core microservice development pattern
- 1.8 Microservice routing patterns
- 1.9 Microservice client resiliency
- 1.10 Microservice security patterns
- 1.11 Microservice logging and tracing patterns
- 1.12 Application metrics pattern
- 1.13 Microservice build/deployment patterns
- Summary
- 2 Exploring the microservices world with Spring Cloud
- 3 Building microservices with Spring Boot
- 4 Welcome to Docker
-
5 Controlling your configuration with the Spring Cloud Configuration Server
- 5.1 On managing configuration (and complexity)
- 5.2 Building our Spring Cloud Configuration Server
-
5.3 Integrating Spring Cloud Config with a Spring Boot client
- 5.3.1 Setting up the licensing service Spring Cloud Config Service dependencies
- 5.3.2 Configuring the licensing service to use Spring Cloud Config
- 5.3.3 Wiring in a data source using Spring Cloud Config Server
- 5.3.4 Directly reading properties using @ConfigurationProperties
- 5.3.5 Refreshing your properties using Spring Cloud Config Server
- 5.3.6 Using Spring Cloud Configuration Server with Git
- 5.3.7 Integrating Vault with the Spring Cloud Config service
- 5.3.8 Vault UI
- 5.4 Protecting sensitive configuration information
- 5.5 Closing thoughts
- Summary
- 6 On service discovery
-
7 When bad things happen: Resiliency patterns with Spring Cloud and Resilience4j
- 7.1 What are client-side resiliency patterns?
- 7.2 Why client resiliency matters
- 7.3 Implementing Resilience4j
- 7.4 Setting up the licensing service to use Spring Cloud and Resilience4j
- 7.5 Implementing a circuit breaker
- 7.6 Fallback processing
- 7.7 Implementing the bulkhead pattern
- 7.8 Implementing the retry pattern
- 7.9 Implementing the rate limiter pattern
- 7.10 ThreadLocal and Resilience4j
- Summary
-
8 Service routing with Spring Cloud Gateway
- 8.1 What is a service gateway?
- 8.2 Introducing Spring Cloud Gateway
- 8.3 Configuring routes in Spring Cloud Gateway
- 8.4 The real power of Spring Cloud Gateway: Predicate and Filter Factories
- 8.5 Building the pre-filter
- 8.6 Using the correlation ID in the services
- 8.7 Building a post-filter receiving correlation ID
- Summary
- 9 Securing your microservices
- 10 Event-driven architecture with Spring Cloud Stream
-
11 Distributed tracing with Spring Cloud Sleuth and Zipkin
- 11.1 Spring Cloud Sleuth and the correlation ID
-
11.2 Log aggregation and Spring Cloud Sleuth
- 11.2.1 A Spring Cloud Sleuth/ELK Stack implementation in action
- 11.2.2 Configuring Logback in our services
- 11.2.3 Defining and running ELK Stack applications in Docker
- 11.2.4 Configuring Kibana
- 11.2.5 Searching for Spring Cloud Sleuth trace IDs in Kibana
- 11.2.6 Adding the correlation ID to the HTTP response with Spring Cloud Gateway
-
11.3 Distributed tracing with Zipkin
- 11.3.1 Setting up the Spring Cloud Sleuth and Zipkin dependencies
- 11.3.2 Configuring the services to point to Zipkin
- 11.3.3 Configuring a Zipkin server
- 11.3.4 Setting tracing levels
- 11.3.5 Using Zipkin to trace transactions
- 11.3.6 Visualizing a more complex transaction
- 11.3.7 Capturing messaging traces
- 11.3.8 Adding custom spans
- Summary
-
12 Deploying your microservices
- 12.1 The architecture of a build/deployment pipeline
- 12.2 Setting up O-stock’s core infrastructure in the cloud
- 12.3 Beyond the infrastructure: Deploying O-stock and ELK
- 12.4 Your build/deployment pipeline in action
- 12.5 Creating our build/deploy pipeline
- 12.6 Closing thoughts on the build/deployment pipeline
- Summary
- appendix A. Microservices architecture best practices
- appendix B. OAuth2 grant types
- appendix C. Monitoring your microservices
- index
- inside back cover
Product information
- Title: Spring Microservices in Action, Second Edition
- Author(s):
- Release date: June 2021
- Publisher(s): Manning Publications
- ISBN: 9781617296956
You might also like
book
Spring Microservices in Action
Spring Microservices in Action teaches you how to build microservice-based applications using Java and the Spring …
book
Microservices with Spring Boot and Spring Cloud - Second Edition
Create and deploy production-quality microservices-based applications — New edition updated for the smooth running of Spring, …
book
Spring Boot in Action
A developer-focused guide to writing applications using Spring Boot. You'll learn how to bypass the tedious …
book
Microservices with Spring Boot 3 and Spring Cloud - Third Edition
Create and deploy production-grade microservices-based applications with this latest edition updated to Spring Boot 3, Java …