👨🏼💻 Efim Shliamin, my certificate: https://www.udemy.com/certificate/UC-e388eb03-dbd9-4d0f-8a5f-fae8fe159697/
⚙️ Testing: right-click on the project and select "Coverage As" > "JUnit Test"
💡 We (can) use the Talend API Tester (Google Chrome extension) as a REST API client to invoke, discover and test HTTP and REST APIs:
- For /auth microservice:
POST http://localhost:8101/auth
Content-Type: application/json
Body: {"userId": "jane", "password": "pass1234"} or Body: {"userId": "maxime", "password": "pass1234"} ➡️ 200 + the unique token
In all other cases: ➡️ 401
- For /songsLists microservice:
POST http://localhost:8201/auth
Content-Type: application/json
Body: {"userId": "jane", "password": "pass1234"} or Body: {"userId": "maxime", "password": "pass1234"} ➡️ 200 + the unique token
In all other cases: ➡️ 401
Then use the unique token like this:
GET http://localhost:8201/songs
Accept: application/json
Authorisation: the unique token
Correct token? ➡️ 200 + list of songs, otherwise ➡️ 401
User holt sich die eigenen SongListen:
GET http://localhost:8201/songsLists?userId=maxime (
Accept: application/json
Authorisation: the unique token
➡️ 200 + list of songs for maxime
User holt sich die SongListen von einer anderen Nutzerin:
GET http://localhost:8201/songsLists?userId=jane (
Accept: application/json
Authorisation: the unique token
➡️ 200 + list of songs for jane
SongListen von nicht existirenden Nutzer:
GET http://localhost:8201/songsLists?userId=usergibtsnicht (
Accept: application/json
Authorisation: the unique token
➡️ 404
Important links:
/auth: http://localhost:8101/auth
/songs: http://localhost:8002/songs
/songsLists: http://localhost:8201/songsLists
Currency Exchange Service: http://localhost:8000/currency-exchange/from/USD/to/INR
Currency Conversion Services:
http://localhost:8100/currency-conversion/from/USD/to/INR/quantity/10
http://localhost:8100/currency-conversion-feign/from/USD/to/INR/quantity/10
Eureka: http://localhost:8761/
API GATEWAY:
http://localhost:8765/currency-exchange/from/USD/to/INR
http://localhost:8765/currency-conversion/from/USD/to/INR/quantity/10
http://localhost:8765/currency-conversion-feign/from/USD/to/INR/quantity/10
http://localhost:8765/currency-conversion-new/from/USD/to/INR/quantity/10
💡 You can use the Talend API Tester (Google Chrome extension) as a REST API client to invoke, discover and test HTTP and REST APIs.
💡 We use Swagger for developing and describing RESTful APIs. Go to http://localhost:8080/swagger-ui/index.html to try.
💡 Content Negotiation: we use fasterxml for implementing support for XML.
💡 We use HAL Explorer for browsing and exploring HAL and HAL-FORMS-based RESTful Hypermedia APIs. Go to http://localhost:8080/swagger-ui/index.html to try.
Please go to https://github.com/shliamin/songsMS-spring-boot
💡 We use Eureka as a Registry/Discovery-Service. Go to http://localhost:8761/ to try.
💡 We use Zipkin as a a distributed tracing system. Go to http://localhost:9411/ to try.
💡 We use Docker.
Step-by-step solution: (provided by this course on Udemy)
-
Designing the REST API
-
Creating User Bean and UserDaoService (data access object)
-
Implementing the GET methods for User Resources
-
Implementing the POST method to create User Resources
-
Enhancing the POST method to return the correct HTTP status code (201)
-
Implementing Exception Handling - 404 - Resource Not Found
-
Implementing Generic Exception Handling for all Resources
-
Implementing the DELETE Method to delete a User Resource
-
Implementing Validations for REST API
-
Configuring Auto Generation of Swagger Documentation
-
Content Negotiation: Implementing support for XML
-
Internationalization for REST API
-
Versioning REST API - URI Versioning (http://localhost:8080/v1/person vs http://localhost:8080/v2/person)
-
Versioning REST API - Request Param, Header, Media Type (VersioningPersonController)
-
Implementing HATEOAS (Hypermedia as the Engine of Application State) for REST API
-
Implementing Static Filtering for REST API
-
Implementing Dynamic Filtering for REST API
-
Monitoring API with Spring Boot Actuator
-
Exploring APIs with Spring Boot HAL Explorer
-
Creating User Entity and some test data. Go to http://localhost:8080/h2-console
-
Enhancing REST API to connect to H2 using JPA and Hibernate
-
Creating Post Entity with Many To One Relationship with User Entity
-
Implementing a GET API to retrieve all Posts of a User
-
Implementing a POST API to create a Post for a User
-
Exploring JPA and Hibernate Queries for REST API
-
Connecting REST API to MySQL Database - Implementation
-
Implementing Basic Authentication with Spring Security
-
Enhancing Spring Security Configuration for Basic Authentication
-
Setting up Limits Microservice
-
Creating a hard-coded limits service
-
Enhance limits service - Get configuration from application props
-
Setting up Spring Cloud Config Server
-
Installing Git and Creating Local Git Repository
-
Debugging problems with Spring Cloud Config Server
-
Connect Spring Cloud Config Server to Local Git Repository
-
Connect Limits Service to Spring Cloud Config Server
-
Configuring Profiles for Limits Service
-
Debugging Guide for Microservices
-
Introduction to Currency Conversion & Exchange Microservices
-
Setting up Currency Exchange Microservice
-
URL and Response Structure for Currency Exchange Service
-
Create a simple hard-coded currency exchange service
-
Setting up Dynamic Port in the Response
-
Configure JPA and Initialized Data
-
Create a JPA Repository
-
Setting up Currency Conversion Microservice
-
Creating a service for currency conversion
-
Invoking Currency Exchange from Currency Conversion Microservice
-
Using Feign REST Client for Service Invocation
-
Understand Naming Server and Setting up Eureka Naming Server
-
Connect Currency Conversion & Currency Exchange Service
-
QuickStart by Importing Microservices
-
Load Balancing with Eureka, Feign & Spring Cloud LoadBalancer
-
Setting up Spring Cloud API Gateway
-
Enabling Discovery Locator with Eureka for Spring Cloud Gateway
-
Exploring Routes with Spring Cloud Gateway
-
Implementing Spring Cloud Gateway Logging Filter
-
Getting started with Circuit Breaker - Resilience4j
-
Playing with Resilience4j - Retry and Fallback Methods
-
Playing with Docker Images and Containers
-
Understanding Docker Architecture - Docker Client, Docker Engine
-
Launching Zipkin Container using Docker
-
Connecting Currency Exchange Microservice with Zipkin
-
Connecting Currency Conversion Microservice & API Gateway
-
Creating Container Images for Currency Exchange Microservice
-
Getting Started with Docker Compose
-
Running Eureka Naming Server with Docker Compose
-
Running Currency Conversion Microservice with Docker Compose
-
Running Spring Cloud API Gateway with Docker Compose
-
Running Zipkin with Docker Compose