Skip to content

eduardNeagoe/currency-exchange-conversion-microservices-spring

Repository files navigation

This is a microservice-based application built with Spring Boot and Spring Cloud.

Detailed tech stack:

  • Spring Boot
  • Spring Cloud Netflix Eureka Server/Client for service discovery and for balancing the load among the service instances
  • Spring Cloud OpenFeign (open-source successor of Netflix Feign) for inter-service communication and load balancing - between the currency and exchange services
  • Spring Cloud Config Server for reading configuration profiles stored remotely in a git repository
  • Spring Cloud Gateway for routing incoming requests to the appropriate services
  • Resilience4j (inspired by Netflix Hystrix) for mechanisms like retry, circuit breaker, rate limiter, bulkhead
  • Zipkin as the implementation of the distributed tracing server for debugging requests among different microservices
  • RabbitMQ as a buffer between the distributed tracing server and the other microservices for preventing message loss in case the distributed tracing server is down
  • Docker for containerization and docker-compose for single step deployment
  • Spring Data JPA for interacting with data
  • H2 Database for in-memory database
  • Lombok for logging and for eliminating boilerplate POJO coding
  • Mapstruct for mapping entities to DTOs and vice-versa
  • Maven as a build tool

Purpose

The purpose of this app is to demonstrate the use of the tech stack described above. It's focused on the technical infrastructure rather than business logic. Therefore, there are no automated tests, but it can be tested manually.
I included an export for Postman here.

Deployment:

Run docker-compose up to start the application.

NOTE: All the docker images you need wil be pulled from my personal docker registry https://hub.docker.com/u/eduardn08. If you encounter any problems pulling the images, then run mvn spring-boot:build-image -DskipTests for every module (microservice) of the app to build the images locally. Then run docker-compose up.

URLS

Naming Server - Eureka

Limits Service

API Gateway

Currency Exchange Service - bypassing gateway

Currency Conversion Service - bypassing gateway

Fault tolerance - Resilience4j:

Architecture overview

cloud-config-server Naming Server load-balancer distributed-tracing-server

Ports

load-balancer

RabbitMQ management port: 15672