/microservice-example

Micro-service examples based on Spring Boot, Spring Cloud and Docker

Microservice Example based on Spring Cloud

This is an example project to demonstrate building micro-services using Spring Boot and Spring Cloud. The project demonstrates the following concepts :-

  • Microservice development using Spring Boot
  • Microservice discovery using Netflix Eureka (Spring Cloud)
  • API Gateway for orchestration between microservices
  • Routing using Netflix Zuul (Spring Cloud)
  • SSL communication between all the services
  • API documentation using Swagger
  • Correlation between microservices using Spring Cloud Sleuth
  • Containerisation of microservices using Docker (WIP)

How to run

Please visit the individual projects for instructions to run the components.

  1. discovery
  2. edge
  3. All other individual micro-services (book, employee etc.)
  4. api-gateway

Architecture diagram

Microservice Architecture

Security between services

HTTPS has been configured for the full service stack. The supported SSL version is TLS 1.2.

  • Edge Server -> API Gateway - One way SSL
  • API Gateway -> Microservices - Two way SSL (mutual authentication)
  • Services -> Discovery Server - One way SSL

Technology choices

The following technology choices have been made.

  • Edge Server - Netflix Zuul
  • Discovery Server - Netflix Eureka
  • API Gateway/Microservices - Spring Boot
  • Datastore - MongoDB

How to run using Docker - WIP

  • Clone the project
  • Build the parent project using : mvn clean install
  • Go to the docker folder under this project and run the command : docker compose up
  • Open http://localhost:8761/ in your browser to see the services registered to Eureka