Chapter 1. Welcome to the cloud, Spring
1.2. What is Spring and why is it relevant to microservices?
1.3. What you’ll learn in this book
1.4. Why is this book relevant to you?
1.5. Building a microservice with Spring Boot
1.6. Why change the way we build applications?
1.7. What exactly is the cloud?
1.8. Why the cloud and microservices?
1.9. Microservices are more than writing the code
1.9.1. Core microservice development pattern
1.9.2. Microservice routing patterns
1.9.3. Microservice client resiliency patterns
1.9.4. Microservice security patterns
1.10. Using Spring Cloud in building your microservices
1.10.3. Spring Cloud service discovery
1.10.4. Spring Cloud/Netflix Hystrix and Ribbon
Chapter 2. Building microservices with Spring Boot
2.1. The architect’s story: designing the microservice architecture
2.1.1. Decomposing the business problem
2.2. When not to use microservices
2.3. The developer’s tale: building a microservice with Spring Boot and Java
2.3.1. Getting started with the skeleton project
2.3.2. Booting your Spring Boot application: writing the Bootstrap class
2.3.3. Building the doorway into the microservice: the Spring Boot controller
2.4. The DevOps story: building for the rigors of runtime
2.4.1. Service assembly: packaging and deploying your microservices
2.4.2. Service bootstrapping: managing configuration of your microservices
2.4.3. Service registration and discovery: how clients communicate with your microservices
Chapter 3. Controlling your configuration with Spring Cloud configuration server
3.1. On managing configuration (and complexity)
3.2. Building our Spring Cloud configuration server
3.2.1. Setting up the Spring Cloud Config Bootstrap class
3.2.2. Using Spring Cloud configuration server with the filesystem
3.3. Integrating Spring Cloud Config with a Spring Boot client
3.3.1. Setting up the licensing service Spring Cloud Config server dependencies
3.3.2. Configuring the licensing service to use Spring Cloud Config
3.3.3. Wiring in a data source using Spring Cloud configuration server
3.3.4. Directly Reading Properties using the @Value Annotation
3.3.5. Using Spring Cloud configuration server with Git
3.3.6. Refreshing your properties using Spring Cloud configuration server
3.4. Protecting sensitive configuration information
3.4.1. Download and install Oracle JCE jars needed for encryption
3.4.2. Setting up an encryption key
3.4.3. Encrypting and decrypting a property
3.4.4. Configure microservices to use encryption on the client side
Chapter 4. On service discovery
4.2. On service discovery in the cloud
4.2.1. The architecture of service discovery
4.2.2. Service discovery in action using Spring and Netflix Eureka
4.3. Building your Spring Eureka Service
4.4. Registering services with Spring Eureka
4.5. Using service discovery to look up a service
4.5.1. Looking up service instances with Spring DiscoveryClient
4.5.2. Invoking services with Ribbon-aware Spring RestTemplate
Chapter 5. When bad things happen: client resiliency patterns with Spring Cloud and Netflix Hystrix
5.1. What are client-side resiliency patterns?
5.2. Why client resiliency matters
5.4. Setting up the licensing server to use Spring Cloud and Hystrix
5.5. Implementing a circuit breaker using Hystrix
5.7. Implementing the bulkhead pattern
5.8. Getting beyond the basics; fine-tuning Hystrix
5.9. Thread context and Hystrix
Chapter 6. Service routing with Spring Cloud and Zuul
6.1. What is a services gateway?
6.2. Introducing Spring Cloud and Netflix Zuul
6.2.1. Setting up the Zuul Spring Boot project
6.3. Configuring routes in Zuul
6.3.1. Automated mapping routes via service discovery
6.3.2. Mapping routes manually using service discovery
6.3.3. Manual mapping of routes using static URLs
6.4. The real power of Zuul: filters
6.5. Building your first Zuul pre-filter generating correlation IDs
6.6. Building a post filter receiving correlation IDs
6.7. Building a dynamic route filter
6.7.1. Building the skeleton of the routing filter
Chapter 7. Securing your microservices
7.2. Starting small: using Spring and OAuth2 to protect a single endpoint
7.2.1. Setting up the EagleEye OAuth2 authentication service
7.2.2. Registering client applications with the OAuth2 service
7.3. Protecting the organization service using OAuth2
7.3.1. Adding the Spring Security and OAuth2 jars to the individual services
7.3.2. Configuring the service to point to your OAuth2 authentication service
7.4. JavaScript Web Tokens and OAuth2
7.4.1. Modifying the authentication service to issue JavaScript Web Tokens
7.4.2. Consuming JavaScript Web Tokens in your microservices
7.5. Some closing thoughts on microservice security
Use HTTPS/Secure Sockets Layer (SSL) for all service communication
Use a services gateway to access your microservices
Zone your services into a public API and private API
Limit the attack surface of your microservices by locking down unneeded network ports
Chapter 8. Event-driven architecture with Spring Cloud Stream
8.1. The case for messaging, EDA, and microservices
8.1.1. Using synchronous request-response approach to communicate state change
8.1.2. Using messaging to communicate state changes between services
8.2. Introducing Spring Cloud Stream
8.3. Writing a simple message producer and consumer
8.3.1. Writing the message producer in the organization service
8.3.2. Writing the message consumer in the licensing service
8.4. A Spring Cloud Stream use case: distributed caching
8.4.1. Using Redis to cache lookups
8.4.2. Defining custom channels
8.4.3. Bringing it all together: clearing the cache when a message is received
Chapter 9. Distributed tracing with Spring Cloud Sleuth and Zipkin
9.1. Spring Cloud Sleuth and the correlation ID
9.1.1. Adding Spring Cloud sleuth to licensing and organization
9.2. Log aggregation and Spring Cloud Sleuth
9.2.1. A Spring Cloud Sleuth/Papertrail implementation in action
9.2.2. Create a Papertrail account and configure a syslog connector
9.2.3. Redirecting Docker output to Papertrail
9.2.4. Searching for Spring Cloud Sleuth trace IDs in Papertrail
9.2.5. Adding the correlation ID to the HTTP response with Zuul
9.3. Distributed tracing with Open Zipkin
9.3.1. Setting up the Spring Cloud Sleuth and Zipkin dependencies
9.3.2. Configuring the services to point to Zipkin
9.3.3. Installing and configuring a Zipkin server
9.3.5. Using Zipkin to trace transactions
9.3.6. Visualizing a more complex transaction
Chapter 10. Deploying your microservices
10.1. EagleEye: setting up your core infrastructure in the cloud
10.1.1. Creating the PostgreSQL database using Amazon RDS
10.2. Beyond the infrastructure: deploying EagleEye
10.3. The architecture of a build/deployment pipeline
10.4. Your build and deployment pipeline in action
10.5. Beginning your build deploy/pipeline: GitHub and Travis CI
10.6. Enabling your service to build in Travis CI
10.6.1. Core build run-time configuration
10.6.2. Pre-build tool installations
10.6.4. Tagging the source control code
10.6.5. Building the microservices and creating the Docker images
10.6.6. Pushing the images to Docker Hub
Appendix A. Running a cloud on your desktop
A.2. Downloading the projects from GitHub
A.4. Building and compiling the projects
Appendix B. OAuth2 grant types