Git Product home page Git Product logo

spring-boot-microservices's Introduction

Spring Boot MicroService Bridge Solution

this is a solution based on micro-service architecture to easily add / remove services providers without effecting other providers and without effecting the main services consumer.

in this solution i used spring boot and spring cloud to implement microservice archtiture here are some of the modules used in the solution:

  • Service Discovery (Eureka Naming Server)
  • Feign Rest Client
  • Hystrix for fault tolerance
  • Rest Controllers
  • Swagger for api documentation

Archticture

In this paragraph i will explain the archticture ,our solution contains five component , four core microservices, bestHotel, crazyHotel ,available hotel which act as a consumer for other services and aggregateHotels, the aggregate hotel micro service act as bridge or as some other people call front door to other underlying micro service ,finally eruka naming server which will register and ease the communication between services.

The purpose of the aggregate service is to be the main portal to microservices leaving each microservice sperate independent from other services,so adding or removing microservice will be maintained only in the aggregate service code, the aggregate service is the key for this structure to because it will calls each relevant microservice collects the data, apply business logic to it, and further publish it is as a REST Endpoint.

Implementating hystrix applied defensive programming strategy is essential, if besthotel service provider went down , our main service consumer won't go down and will not recive an error but instead hystrix will call a FallBack Command which will handle besthotel microservice fauiler.

alt text

To run and test the project please run the following respectively

  • Eruka Naming Server (must be first)
  • Best Hotel Serivce
  • Crazy Hotel Service
  • Aggregate Hotel Serivce
  • Available Hotel Service (Consumer Service)

After luanching the projects ,testing the main consumer service available hotel can be done through swagger at: http://localhost:8082/swagger-ui.html#/

Please note that Shutting down any of the provider service won't effect the overwhole process ,as if crazy hotel service provider shut down ,the following will happen:

  • hystrix fall back will be triggered
  • aggregate service will collect data from alive providers in our case besthotels service
  • our consumer will still gets the data of best hotels after all.

Future Improvements :

✔️ cover the solution with unit testing using JUnit added junit for both best hotel and crazy hotel micro service

  • add Load Balancing Ribbons to microservice .

please feel free to ⭐ happy programming ✌️

spring-boot-microservices's People

Contributors

alaamezian avatar amalsadi avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.