This example-rich tutorial shows how to design and manage large-scale Java applications as a collection of microservices. Starting with an overview of microservices from a Java EE perspective, you'll learn how to refactor your existing applications as microservices and build microservice-based applications from scratch. You'll power through practical tutorials as you call and connect microservices, understand what load balancing is, and use Netflix Hystrix for fault tolerance. You'll also master security and testing, as well as deploying to the cloud.
Part 1: Getting Started
1. Enterprise Java Microservices
1.1. Enterprise Java pitfalls
1.1.1. What is Enterprise Java?
1.1.2. Typical Enterprise Java Architecture
1.1.3. What is a Monolith?
1.1.4. Why Hate the Monolith?
1.2. Microservices and Distributed Architecture
1.2.1. Do One Thing Well
1.2.2. What is a Distributed Architecture?
1.2.3. Why should I care about being Distributed?
1.2.4. What can be done to assist in developing Microservices?
1.2.5. Product over Project
1.2.6. Continuous Integration and Delivery
1.3. Patterns for migration to microservices
1.3.1. Domain Driven Design
1.3.2. Big Bang Pattern
1.3.3. Strangler Pattern
1.3.4. Hybrid Pattern
1.4. What are Enterprise Java Microservices?
1.4.1. Why Enterprise Java is a good fit for Microservices
2. Developing a Simple RESTFul Microservice
2.1. Introducing the Simple Microservice
2.1.1. Address Management application
2.1.2. Application Use Cases
2.1.3. Architecture of the Application
2.2. Creating RESTFul endpoints with JAX-RS
2.2.1. View all addresses
2.2.2. Delete an address
2.2.3. Add an address
2.2.4. Run it
3. Just enough Application Server for Microservices
3.1. Just enough Application Server
3.1.1. What does it mean?
3.1.2. What are the benefits?
3.2. Choosing Just enough Application Server
3.2.1. Beach Vacation example application
3.2.2. Dropwizard - The Original Opinionated Microservice runtime
3.2.3. Payara Micro - Slimmed Java EE App Server in a Jar
3.2.4. Spring Boot - Opinionated Spring Microservices
3.2.5. WildFly Swarm - The Most Flexible JeAS Runtime
3.2.6. How do they compare?
Part 2: Microservices with Enterprise Java
4. Consuming Microservices
5. Discovering Microservices for consumption
6. Strategies for Fault Tolerance and Monitoring
7. Securing a Microservice
Part 3: Breaking Down a "Monolith"
8. Architecting a Microservice Hybrid
9. Splitting out our First Microservice
10. Integrating the Microservice into the "Monolith"
11. Spring Microservices and Java EE
12. Reactive Microservices and Java EE
13. Deploying to the Cloud
About the Technology
Over time, enterprise-grade Java applications can become giant hulking beasts of intertwined code, bloated with third-party libraries, and vulnerable to total collapse when a single part fails. It doesn't have to be that way! Microservices break down a large application into smaller components, each interacting with each other to create a united whole. As each component can start, stop, and scale independently, so the whole system benefits from better fault-tolerance and resilience. Equally-important, separating the application into smaller independent services makes it substantially easier to efficiently manage the development and incremental improvement of your system.
- The microservices mental model
- Fault tolerance with Netflix Hystrix
- Securing your microservices
- Deploying to the cloud
About the reader
This book is for Java developers familiar with distributed n-tier application architecture.