Spring MicroServices
Overview
Implementation microservices using Spring Cloud.
- Establishing Communication between Microservices
- Centralized Microservice Configuration with Spring Cloud Config Server
- Spring Cloud Bus to exchange messages about Configuration updates
- Communication with other Microservices using Feign REST Client
- Implementation client side load balancing with Ribbon
- Implementation dynamic scaling using Eureka Naming Server and Ribbon
- Implementation API Gateway with Zuul
- Implementation Distributed tracing with Spring Cloud Sleuth and Zipkin
- Implementation Fault Tolerance with Zipkin
Installing Tools
- PostMan
- Git Client - https://git-scm.com/
- Rabbit MQ - https://www.rabbitmq.com/download.html
Installing Rabbit MQ
Windows
- https://www.rabbitmq.com/install-windows.html
- https://www.rabbitmq.com/which-erlang.html
- http://www.erlang.org/downloads
- Video - https://www.youtube.com/watch?v=gKzKUmtOwR4
Mac
Ports
Application | Port |
---|---|
Limits Service | 8080, 8081, ... |
Spring Cloud Config Server | 8888 |
Currency Exchange Service | 8000, 8001, 8002, .. |
Currency Conversion Service | 8100, 8101, 8102, ... |
Netflix Eureka Naming Server | 8761 |
Netflix Zuul API Gateway Server | 8765 |
Zipkin Distributed Tracing Server | 9411 |
URLs
Application | URL |
---|---|
Limits Service | http://localhost:8080/limits POST -> http://localhost:8080/actuator/refresh |
Spring Cloud Config Server | http://localhost:8888/limits-service/default http://localhost:8888/limits-service/dev |
Currency Converter Service - Direct Call | http://localhost:8100/currency-converter/from/USD/to/INR/quantity/10 |
Currency Converter Service - Feign | http://localhost:8100/currency-converter-feign/from/EUR/to/INR/quantity/10000 |
Currency Exchange Service | http://localhost:8000/currency-exchange/from/EUR/to/INR http://localhost:8001/currency-exchange/from/USD/to/INR |
Eureka | http://localhost:8761/ |
Zuul - Currency Exchange & Exchange Services | http://localhost:8765/currency-exchange-service/currency-exchange/from/EUR/to/INR http://localhost:8765/currency-conversion-service/currency-converter-feign/from/USD/to/INR/quantity/10 |
Zipkin | http://localhost:9411/zipkin/ |
Spring Cloud Bus Refresh | http://localhost:8080/bus/refresh |
Zipkin Installation
Quick Start Page
Downloading Zipkin Jar
Command to run
RABBIT_URI=amqp://localhost java -jar zipkin-server-2.5.2-exec.jar
VM Argument
-Dserver.port=8001
Commands
mkdir git-configuration-repo
cd git-configuration-repo/
git init
git add -A
git commit -m "first commit"
Spring Cloud Configuration
spring.cloud.config.failFast=true
More Reading about Microservices
- Design and Governance of Microservices
- 12 Factor App
- Spring Cloud