Coder Social home page Coder Social logo

kingkhay / sample-spring-microservices-new Goto Github PK

View Code? Open in Web Editor NEW

This project forked from piomin/sample-spring-microservices-new

0.0 0.0 0.0 192 KB

Demo for Spring Boot 3(`master` branch)/2(other branches) and Spring Cloud microservices with distributed configuration (Spring Cloud Config), service discovery (Eureka), API gateway (Spring Cloud Gateway, Zuul), Swagger/OpenAPI documentation (Springdoc), logs correlation using Spring Cloud Sleuth/Micrometer OTEL and many more

Home Page: https://piotrminkowski.com

Java 99.38% Dockerfile 0.62%

sample-spring-microservices-new's Introduction

Microservices with Spring Cloud Advanced Demo Project Twitter

CircleCI

SonarCloud Bugs Coverage Lines of Code

In this project I'm demonstrating you the most interesting features of Spring Cloud Project for building microservice-based architecture.

Getting Started

Currently you may find here some examples of microservices implementation using different projects from Spring Cloud. All the examples are divided into the branches and described in a separated articles on my blog. Here's a full list of available examples:

  1. (This example has been update to the latest version of Spring Cloud without Zuul) Using Spring Cloud Netflix Eureka as a discovery server, Zuul as a gateway, OpenFeign for communication and Spring Cloud Config Server. The example is available in the branch master. A detailed guide may be find in the following article: Quick Guide to Microservices with Spring Boot 2.0, Eureka and Spring Cloud
  2. Using Spring Cloud Alibaba Nacos as a discovery and configuration server, Zuul and OpenFeign. The example is available in the branch alibaba. A detailed guide may be find in the following article: Microservices with Spring Cloud Alibaba
  3. Using Spring Cloud with Spring Boot support for GraphQL for building microservices, Apollo for inter-service communication and Eureka as a discovery server. The example is available in the branch graphql. A detailed guide may be find in the following article: GraphQL โ€“ The Future of Microservices?
  4. Using Spring Boot and partially Spring Cloud for building microservices deployed on OpenShift with Source-2-Image mechanism. The example is available in the branch openshift. A detailed guide may be find in the following article: Running Java Microservices on OpenShift using Source-2-Image
  5. Using Trampoline for managing group of Spring Boot microservices locally. The example is available in the branch trampoline. A detailed guide may be find in the following article: Managing Spring Boot apps locally with Trampoline
  6. Using Spring Boot 3, Micrometer Tracing and Springdoc for building microservices with Spring Cloud. A detailed guide may be found in the following article: Microservices with Spring Boot 3 and Spring Cloud

Usage

Build the apps with images (we need ji for config-service since it contains curl):

$ mvn clean package -Pbuild-image jib:dockerBuild

Then run all the containers with docker-compose:

$ docker-compose up

In the most cases you need to have Maven and JDK8+. In the fourth example with OpenShift you will have to run Minishift on your machine. The best way to run the sample applications is with IDEs like IntelliJ IDEA or Eclipse.

Architecture

Our sample microservices-based system consists of the following modules:

  • gateway-service - a module that Spring Cloud Netflix Zuul for running Spring Boot application that acts as a proxy/gateway in our architecture.
  • config-service - a module that uses Spring Cloud Config Server for running configuration server in the native mode. The configuration files are placed on the classpath.
  • discovery-service - a module that depending on the example it uses Spring Cloud Netflix Eureka or Spring Cloud Netlix Alibaba Nacos as an embedded discovery server.
  • employee-service - a module containing the first of our sample microservices that allows to perform CRUD operation on in-memory repository of employees
  • department-service - a module containing the second of our sample microservices that allows to perform CRUD operation on in-memory repository of departments. It communicates with employee-service.
  • organization-service - a module containing the third of our sample microservices that allows to perform CRUD operation on in-memory repository of organizations. It communicates with both employee-service and organization-service.

The following picture illustrates the architecture described above.


sample-spring-microservices-new's People

Contributors

piomin avatar renovate[bot] avatar bayboraoren 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.