Java Microservices with Spring in 3 Weeks
Published by O'Reilly Media, Inc.
Spring Boot and Spring Cloud best practices for creating effective and resilient microservices
Microservices have become a de facto standard architecture pattern of today’s software because they give developers a lot of freedom to use the right tool and language to solve a given business problem. The Spring Framework—specifically, Spring Boot and Spring Cloud—has revolutionized modern Java microservice development. With these frameworks, you can set up your applications in no time, reusing abstractions dedicated to working in the cloud regardless of your chosen platform.
Join expert Marcin Grzejszczak for a deep dive into how Spring Boot and Spring Cloud work with Kubernetes to create and deploy your microservices. Learn how you can leverage these frameworks to do HTTP and messaging-based communication and how to set up metrics with Micrometer and do latency analysis and log correlation. You’ll discover how to use chaos engineering to test a deployed Spring application and how feature toggling can help you alter the behavior of applications at runtime. In three weeks, you’ll understand how to make your microservices communicate in a resilient manner and how to interact with your deployed-to-production application.
Week 1: Introduction to Microservices with Spring Boot and Spring Cloud
In Week 1, you'll explore some of the fundamental features of Spring Cloud that abstract the underlying platform where the application is deployed. You’ll also learn when it’s appropriate to use Spring Cloud Kubernetes and when it’s not.
Week 2: Microservice Communication with Spring Boot and Spring Cloud
In Week 2, you’ll see how to leverage service discovery so as not to hardcode IP and ports of other applications. You’ll use circuit breakers to ensure that your system is stable when one of its components is misbehaving, and you’ll build an API gateway using Spring Cloud Gateway. You’ll also get an introduction to Spring Cloud Stream and learn how to decouple messaging functions from the broker to which the messages will be sent.
Week 3: Application Observability with Spring Boot and Spring Cloud
In the final week, you’ll be introduced to Micrometer, Spring Boot, and Spring Cloud Sleuth as the mechanisms that give you metrics, application traceability, and distributed tracing context propagation. You'll see how to use the Spring Boot Chaos Monkey to introduce chaos testing into an application and how you can alter an application running on production with feature toggles.
NOTE: With today’s registration, you’ll be signed up for all three sessions. Although you can attend any of the sessions individually, we recommend participating in all three weeks.
What you’ll learn and how you can apply it
By the end of this live, hands-on, three-part series, you’ll understand:
Week 1: Introduction to Microservices with Spring Boot and Spring Cloud
- What Spring Boot is
- How Spring Cloud depends on Spring Boot
- How Spring Boot, Spring Cloud, and Kubernetes work best together
Week 2: Microservice Communication with Spring Boot and Spring Cloud
- What service discovery is
- How to set up communication between microservices via HTTP and messaging
- What an API gateway is
Week 3: Application Observability with Spring Boot and Spring Cloud
- What application observability is
- What chaos engineering is
- What feature toggles are
And you’ll be able to:
Week 1: Introduction to Microservices with Spring Boot and Spring Cloud
- Create Docker containers of Spring Boot applications
- Refresh the application configuration with Spring Cloud Config server and client
- Work with Spring Boot and Kubernetes
Week 2: Microservice Communication with Spring Boot and Spring Cloud
- Communicate with microservices over HTTP and messaging
- Create an API gateway configured via YAML and Java code
- Make your microservices communicate in a resilient way
Week 3: Application Observability with Spring Boot and Spring Cloud
- Introduce metrics and distributed tracing to your Java application
- Assert your application behavior with chaos engineering
- Toggle the state of your application with feature toggles
This live event is for you because...
- You’re a software developer and a Java engineer.
- You work with microservices.
- You want to become a proficient microservice developer.
Prerequisites
- Familiarity with the Spring Framework
- A basic understanding of Docker
Recommended preparation:
- Take Spring and Spring Boot in 3 Weeks (live online training course with Ken Kousen)
- Take Microservices in 3 Weeks (live online training course with Sam Newman)
- Take Microservices Fundamentals (live online training course with Sam Newman)
Recommended follow-up:
- Read Building Microservices with Spring Boot (book)
- Read Building Microservices, second edition (book)
- Read Spring Boot Up and Running (book)
Schedule
The time frames are only estimates and may vary according to how the class is progressing.
Week 1: Introduction to Microservices with Spring Boot and Spring Cloud
Spring Boot and Project Initializr (60 minutes)
- Presentation: Introduction to Spring Boot and Project Initializr; how dependency management works; how Project Initializr generates projects
- Hands-on exercise: Explore Project Initializr and basic concepts of Spring Boot
- Q&A
- Break
Spring Cloud and context refresh (60 minutes)
- Presentation and demo: Introduction to Spring Cloud; how context refreshing works
- Hands-on exercise: Refresh context
- Q&A
- Break
Configuration management with Spring Cloud Config (60 minutes)
- Presentation: The concepts of configuration management with Spring Cloud Config server; how to set up the server and the client side
- Hands-on exercise: Read configuration from an external source
- Q&A
- Break
Spring Boot, Spring Cloud, and Kubernetes (45 minutes)
- Presentation and demo: What Spring Boot, Spring Cloud, and Kubernetes have to do with each other; how an application changes its behavior when deployed to Kubernetes
- Hands-on exercise: Create a Docker image of a Spring Boot application
Wrap-up and Q&A (15 minutes)
Week 2: Microservice Communication with Spring Boot and Spring Cloud
Spring Cloud and service discovery (60 minutes)
- Presentation and demo: Introduction to service discovery in Spring Cloud; how applications talk to each other via service discovery
- Hands-on exercise: Create a client and server HTTP applications
- Q&A
- Break
Resilient HTTP communication with Spring Cloud Circuit Breaker (60 minutes)
- Presentation and demo: Introduction to circuit breakers and how Spring Cloud Circuit Breaker works
- Hands-on exercise: Use Circuit Breaker
- Q&A
- Break
Message-based communication with Spring Cloud Stream (60 minutes)
- Presentation: Introduction to messaging; basics of Spring Cloud Stream
- Hands-on exercise: Live code message-based communication between two microservices
- Q&A
- Break
Writing an API gateway using Spring Cloud Gateway (45 minutes)
- Presentation: Introduction to the API gateway; the basics of Spring Cloud Gateway
- Hands-on exercise: Write an API gateway with YAML and code-based configuration
Wrap-up and Q&A (15 minutes)
Week 3: Application Observability with Spring Boot and Spring Cloud
Doing application metrics with Micrometer (60 minutes)
- Presentation and demo: Introduction to application metrics and why they are critical; how Micrometer works with Spring Boot
- Hands-on exercise: Create metrics in an application
- Q&A
- Break
Distributed tracing with Spring Cloud Sleuth (60 minutes)
- Presentation and demo: Introduction to distributed tracing; Spring Cloud Sleuth basics
- Hands-on exercise: Log correlation and latency visualization of a Spring Cloud application
- Q&A
- Break
Chaos engineering with Spring Boot Chaos Monkey (60 minutes)
- Presentation and demo: Introduction to chaos engineering; Chaos Monkey basics
- Hands-on exercise: Run Chaos Monkey against a Spring Cloud app
- Q&A
- Break
Using feature toggles within your application (45 minutes)
- Presentation and demo: Introduction to feature toggles; the most frequently used tools
- Hands-on exercise: Add a feature toggle to an application
Wrap-up and Q&A (15 minutes)
Your Instructor
Marcin Grzejszczak
Marcin Grzejszczak is a software engineer at Broadcom, where he works on Spring Cloud Contract, and Micrometer projects. He’s written two books on Mockito and coauthored multiple video courses.
Skills covered
- Spring
- Microservices