Spring Boot Microservices and Spring Cloud

Spring Boot Microservices and Spring Cloud

English | MP4 | AVC 1280×720 | AAC 44KHz 2ch | 18 Hours | 8.02 GB

Learn to build RESTful Microservices with Spring Boot and Spring Cloud

This video course is for Beginners who have never build RESTful Web Services and Microservices before. It will guide you step-by-step through basics and will help you create and run RESTful Microservices from scratch. You will learn how to run Microservices on your own developer’s machine as well as in Docker Containers on AWS EC2 Linux machines.

By the end of this course, you will have your own RESTful Spring Boot Microservices built and running in Spring Cloud.

You will learn how to create and run your own:

  • RESTful Microservices,
  • Eureka Discovery Service,
  • Zuul API Gateway,
  • Spring Cloud API Gateway,
  • Load Balancer,
  • Spring Cloud Config Server,
  • You will learn to use:
  • Spring Cloud Bus and Rabbit MQ,
  • Spring Boot Actuator

You will also learn how to implement for your REST API features like:

  • User Authentication(Login) and,
  • User Authorization(Registration)
  • You will learn to use:
  • Spring Security and JWT

You will learn how to use:

  • Spring Data JPA to store user details in a database,
  • H2 in-memory database and a database console,
  • MySQL database server,
  • Postman HTTP Client,
  • Spring Tool Suite,
  • Spring Initializer
  • This course also covers how to:
  • Trace HTTP Requests with Spring Cloud Sleuth and Zipkin(Distributed tracing)
  • Aggregate log files in one place(Centralized logging) with ELK stack(Logstash, Elasticsearch, Kibana).

You will also learn how to:

  • Start up AWS EC2 Linux machine,
  • Install Docker,
  • Create Docker images,
  • Run Microservices in Docker containers on multiple EC2 Linux machines in Amazon AWS Cloud.

What you’ll learn

  • Build and run RESTful Microservices
  • Implement User Authentication
  • Eureka Discovery Service
  • Implement User Authorization with Spring Security and JWT
  • Spring Cloud API Gateway
  • Learn to use JPA to persist data into a Database
  • Cloud Cloud Config Server
  • Learn to install MySQL Server and persist data into MySQL
  • Spring Cloud Bus and Rabbit MQ
  • H2 in-memory database and H2 Console
  • Spring Boot Actuator
  • Learn to use HTTP Postman
  • Use Spring Security
  • Learn to use Spring Initializer
  • Distributed Tracing with Sleuth and Zipkin
  • Learn to use Spring Tool Suite
  • Centralized Logging with ELK Stack(Logstash, Elasticsearch, Kibana)
  • Run Microservices in Docker Containers
Table of Contents

1 Source Code
2 Course Overview
3 A few suggestions
4 What is a Microservice
5 Sample Microservices Architecture
6 Download and Install Postman HTTP Client
7 Postman Overview
8 Resource and Collection URIs
10 HTTP Headers Accept and Content Type

Setting up Development Environment
11 Install Java Platform(JDK)
12 Download and Install Spring Tool Suite(STS)

Building RESTful Web Services – A Quick Start. (Optional)
13 Introduction
14 Creating a New Project
15 Creating a new Spring project using Spring Boot Initializr
16 Create Users Rest Controller class
17 Adding Methods to Handle POST, GET, PUT, DELETE HTTP requests
18 Running Web Service Application
19 Reading Path Variables with @PathVariable annotaion
20 Reading Query String Request Parameters
21 Making Parameters Optional or Required
22 Returning Java Object as Return Value
23 Returning Object as JSON or XML Representation
24 Set Response Status Code
25 Reading HTTP POST Request Body. The @RequestBody annotation
26 Validating HTTP POST Request Body
27 Store Users Temporary
28 Handle HTTP PUT Request
29 Handle HTTP Delete Request
30 Handle an Exception
31 Return Custom Error Message Object
32 Handle a Specific Exception
33 Throw and Handle You Own Custom Exception
34 Catch More Than One Exception with One Method
35 Dependency Injection Create and Autowire a Service Layer Class
36 Constructor Based Dependency Injection
37 Run Web Service as a Standalone Application

Eureka Discovery Service – A Quick Start
38 Introduction to Eureka Discovery Service
39 Startup Eureka Service Discovery

Users Microservice – A Quick Start
40 Introduction to Building a Users Microservice
41 Users Microservice – Create new Spring Boot Project
42 Enable Spring Discovery Cloud Client
43 Create Users Rest Controller
44 Access Users Web Service Endpoint via Eureka Discovery Service
45 Exercise – Create Account Management Microservice

Account Management Microservice – A Quick Start
46 Introduction to Building an Account Management Microservice
47 Password Reset – Create a new Spring Boot Project
48 Access Account Management Microservice via Eureka Discovery Service

Zuul API Gateway – A Quick Start
49 Important note
50 Introduction to Zuul API Gateway
51 Create a ZUUL API Gateway Project
52 Access Microservices via API Gateway

Zuul as a Load Balancer – A Quick Start
53 Important note
54 Load Balancer – Introduction
55 Starting Up More Microservices
56 Trying How Load Balancer Works

Spring Cloud API Gateway
57 Important Note
58 Introduction
59 Creating API Gateway Project
60 Automatic Mapping of Gateway Routes
61 Manually Configuring API Gateway Routes
62 Trying how it works
63 Rewriting URL Path
64 Automatic & Manual Routing
65 Build-In Predicate Factories
66 Gateway Filters

Spring Cloud API Gateway as a Load Balancer
67 Starting Up More Microservices
68 Trying How Load Balancer Works

H2 In-Memory Database
69 H2 In-memory Database. Introduction
70 H2 Database Console Overview
71 Adding Support for the H2 Database

Users Microservice – Implementing User Sign up
72 Introduction
73 Adding method to handle HTTP Post Request
74 Implementing the Create User Request Model class
75 Validating HTTP Request Body
76 Application Layers
77 Implementing Service Layer Class
78 Create a Shared DTO Class
79 Generate Unique Public User Id
80 Adding Support for Spring Data JPA
81 Implementing User Entity Class
82 Implementing Spring Data JPA CRUD Repository
83 Save User Details in Database
84 Return Http Status Code
85 Implementing Create User Response Model
86 Add Spring Security to Users Microservice
87 Add WebSecurity Configuration
88 Encrypt User Password
89 Allow only IP address of Zuul API Gateway
90 Adding Support to Return JSON or XML

Users Microservice – Implementing User Login
91 Introduction
92 Implementing LoginRequestModel
93 AuthenticationFilter. Implementing attemptAuthentication()
94 Implementing loadUserByUserName()
95 AuthenticationFilter. Implementing successfulAuthentication()
96 Trying How User Login Works
97 Customize User Authentication URL

Enable Spring Security in Zuul API Gateway
98 Important note
99 Introduction to Spring Security on API Gateway
100 Adding Support for Spring Security and JWT Tokens
101 Enable Web Security in Zuul
102 Allow Access to Registration and Login Urls
103 Implementing Authorization Filter
104 Accessing Protected Microservices with Access Token

Spring Cloud API Gateway – Creating a Custom Filter
105 Introduction
106 Using Header Predicate
107 Adding Support for JWT Token Validation
108 Creating AuthorizationFilter class
109 Assign Custom Filter to a Gateway Route
110 Signup and Login Routes
111 Reading Authorization HTTP Header
112 Validating JWT Access Token
113 Accessing Protected Microservices with Access Token

Spring Cloud Config Server – Git Backend
114 Introduction to Spring Cloud Config Server
115 Create Your Own Config Server
116 Create Private GitHub Repository
117 Naming Property Files Served by Config Server
118 Configure Config Server to Access Private GitHub Repository
119 Adding Properties File to Git Repository
120 Configure Users Microservice to be a Client of Config Server
121 Make Zuul Gateway a Client of Config Server

Spring Cloud Bus – A Quick Start
122 Introduction to Spring Cloud Bus
123 Add Spring Cloud Bus & Actuator Dependencies
124 Enable the bus-refresh URL Endpoint
125 Download and Run Rabbit MQ
126 Rabbit MQ Default Connection Details
127 Trying how Spring Cloud Bus Works
128 Change default Rabbit MQ Password

Spring Cloud Config – File System Backend
129 Introduction to Spring Cloud Config File System as a Backend
130 Setting up File System Backend
131 Previewing Values Returned by Config Server
132 Trying how Microservices work

Spring Cloud Config – Configuration for Multiple Microservices
133 Introduction
134 Shared and a Microservice specific properties

Spring Boot Actuator – A Quick Start
135 Introduction to Spring Boot Actuator
136 Add Spring Boot Actuator to API Gateway
137 Trying How It Works
138 Enable Actuator for Users Microservice

Using MySQL Instead of In-Memory Database
139 Introduction
140 Download and Install MySQL
141 Start MySQL Server and Login
142 Create MySQL Database And a New User
143 Downloading and Installing MySQL Workbench
144 Connect to MySQL Database using MySQL WorkBench
145 MySQL WorkBench brief overview
146 Configure MySQL Database Access Details
147 Use H2 Console to Access MySQL Database
148 Copy MySQL properties to a Config Server

Encryption and Decryption
149 Introduction to Encryption and Decryption of Configuration Properties
150 Add Java Cryptography Extension
151 Symmetric Encryption of Properties
152 Creating a Keystore for Asymmetric Encryption
153 Asymmetric Encryption of Properties

Microservices Communication
154 Introduction to Microservices Communication
155 Albums Microservices Source Code
156 Clone Source Code of Albums Microservice
157 A walk through an Albums Microservice
158 Implementing Get User Details
159 Make Users Microservice call Albums Microservice
160 Trying how it works
161 Feign Web Service Client – Introduction
162 Enable Feign in Spring Boot Project
163 Create Feign Client
164 Using Feign Client
165 Trying How Feign Client Works
166 Enable HTTP Requests Logging in Feign Client
167 Handle FeignException
168 Handle Response Errors with Feign Error Decoder
169 Hystrix Circuit Breaker & Feign. Introduction
170 Configure Project to use Hystrix Circuit Breaker
171 Trying How Hystrix Circuit Breaker & Feign work
172 Error Handling with Feign Hystrix FallbackFactory

Distributed Tracing with Sleuth and Zipkin
173 Introduction to Distributed Tracing with Sleuth and Zipkin
174 Add Spring Cloud Sleuth to Users Microservice
175 Checking Trace ID and Span ID in a Console
176 Startup Zipkin Server
177 View Traces in Zipkin

Aggregating Log Files with ELK Stack
178 Introduction to Aggregating Log Files with ELK Stack
179 Configure Microservices to Log into a File
180 Download Logstash
181 Configure Logstash to Read Log Files
182 Download and Run Elasticsearch
183 Run Search Query
184 Download, Install and Run Kibana
185 View Aggregated Logs in Kibana

Secure Eureka Dashboard
186 Configure Spring Security to Eureka Server
187 Enable Web Security
188 Configure Eureka Clients to use Username and Password
189 Configure Eureka Service URL in Config Server
190 Move Username and Password to Config Server
191 Encrypting Username and Password

Running Microservices in Docker Containers to AWS EC2
192 Introduction to Running Microservices in Docker Containers
193 Start up a new Linux Server on AWS EC2
194 Connect to EC2 Instance
195 Docker Commands Used in this Video Course
196 Install Docker on AWS EC2
197 Docker Hub Introduction
198 Run RabbitMQ Docker Container
199 Basic Docker Commands Run, Stop, Start, Remove Containers and Images
200 Create Config Server Docker Image
201 Publish Config Server Docker Image to Docker Hub
202 Run Config Server on EC2 from Docker Hub
203 Start New EC2 Instance for Eureka
204 Build Docker Image for Eureka Discovery Service
205 Run Eureka in Docker container
206 Elastic IP address for EC2 Instance
207 Create Zuul Api Gateway Docker Image
208 Run Zuul Api Gateway in Docker Container
209 Run Elastic Search in Docker container
210 Run Kibana in Docker Container
211 Run Kibana and Elastic Search on the same Network
212 Docker Image for Albums Microservice
213 Run Albums Microservice Docker Image on EC2
214 Logstash Docker Image for Albums Microservice
215 Run Logstash in Docker container
216 Run MySQL in Docker Container
217 Make MySQL Docker Container Persist Data on EC2
218 Build Users Microservice Docker Image
219 Run Users Microservice in Docker container
220 Run Logstash for Users Microservice

Multiple Environments Dev, Prod
221 Introduction
222 Preparing Configuration for another environment
223 Creating Beans Based on Spring Boot @Profile used
224 Running Docker Container for Different Environments

Downstream Microservice and Method-Level Security
225 Introduction
226 Pass Authorization Header to Downstream Microservice
227 Add AuthorizationFilter to Users Microservice
228 Configure HttpSecurity
229 Trying how it works
230 Introduction to Method-Level security
231 Enable Method-Level Security
232 @PreAuthorize annotation example
233 Trying how @PreAuthorize annotation works
234 @PostAuthorize annotation example