Skip to content

Simple demonstration of various Spring Cloud modules using Consul and Resilience4j.

Notifications You must be signed in to change notification settings

agapebondservant/springcloudmeetup2020

Repository files navigation

Demonstration of Spring Cloud with Consul and Resilience4j

Overview

This is a suuuper basic Voter Dashboard app that aggregates real-time data from 2 separate teams ("Red" squad and "Blue" squad) and displays it in a visualization. The microservices collect voting data and send it to the front-end app via an API Gateway. To do this, it utilizes:

  • Spring Webflux for reactive web API;
  • Spring Cloud Consul Discovery for service discovery;
  • Spring Cloud Loadbalancer for client-side loadbalancing;
  • Spring Cloud CircuitBreaker + Resilience4j for circuit-breaking;
  • Spring Cloud Gateway for API Gateway.

Other enhancements that can be easily introduced:

  • Spring Cloud Config for externalized configuration;
  • Spring Cloud Sleuth & Spring Cloud Zipkin for distributed tracing;
  • Spring Cloud Rabbit for messaging;
  • Spring Cloud Contract for contract testing;
  • etc...

Architecture Overview

How to run

  • After cloning, execute the following from the root:
git submodule init
git submodule update
  • Download and run consul:

    • Use the download instructions provided here to download the consul binary to your local machine.
    • Use the instructions provided here to install consul.
    • Start a consul agent in server mode: consul agent -server=true -bootstrap=true -client=0.0.0.0 -ui -data-dir=/tmp/consul
    • Verify that it's running by going here on your browser.
  1. Cd into the root directories for each submodule and run ./mvnw spring-boot:run to start each service.

  2. Navigate to this link on your browser. The dashboard app should be shown with data populating.

About

Simple demonstration of various Spring Cloud modules using Consul and Resilience4j.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published