Coder Social home page Coder Social logo

karthikeyan1993 / sample-spring-microservices Goto Github PK

View Code? Open in Web Editor NEW

This project forked from piomin/sample-spring-microservices

0.0 1.0 0.0 105 KB

Many samples in different branches that shows how to create microservices with Spring Boot, Spring Cloud, Zipkin, Zuul, Eureka, Hystrix, Kubernetes, Elastic Stack and many more tools

Home Page: https://piotrminkowski.wordpress.com/

Java 91.42% Dockerfile 8.58%

sample-spring-microservices's Introduction

Microservices with Spring Cloud Demo Project Twitter

In this project I'm demonstrating you the most interesting features of Spring Cloud Project for building microservice-based architecture. Most of examples are based on Spring Boot 1.5.

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. Introduction to Spring Cloud components like discovery with Eureka, load balancing with Ribbon, REST client Feign, API gataway with Zuul. The example is available in the branch master. A detailed description can be found here: Part 1: Creating microservice using Spring Cloud, Eureka and Zuul
  2. Introduction to Spring Cloud components used for microservices monitoring like Spring Cloud Sleuth and Zipkin. Integration with Logstash for sending logs to ELK. The example is available in the branch logstash. A detailed description can be found here: Part 2: Creating microservices โ€“ monitoring with Spring Cloud Sleuth, ELK and Zipkin
  3. Introduction to load balancing with Ribbon and Feign declarative HTTP client, circuit braker and fallback with Hystrix. The example is available in the branch hystrix. A detailed description can be found here: Part 3: Creating Microservices: Circuit Breaker, Fallback and Load Balancing with Spring Cloud
  4. Using tool Spring Boot Admin for managing and monitoring microservices-based system. The example is available in the branch admin. A detailed description can be found here: Monitoring Microservices With Spring Boot Admin
  5. Deploying and running Spring Boot microservices on Kubernetes including inter-service communication using Feign client and integration with database Mongo. The example is available in the branch kubernetes. A detailed description can be found here: Microservices with Kubernetes and Docker

Usage

In the most cases you need to have Maven, JDK8+ and Docker for running third-party software like Zipkin or Logstash. In the fifth example with Kubernetes you will have to run Minikube on your local machine. The best way to run the sample applications is with IDEs like IntelliJ IDEA or Eclipse.

How to Run

docker-compose up

If you want to change anything on any service(s), you need to build the service(s) you changed and then :

docker-compose build docker-compose up

How to Run

docker-compose down

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 as an embedded discovery server.
  • account-service - a module containing the first of our sample microservices that allows to perform CRUD operation on in-memory repository of accounts
  • customer-service - a module containing the second of our sample microservices that allows to perform CRUD operation on in-memory repository of customers. It communicates with account-service.
  • zipkin-service - a module that runs embedded Zipkin instance.

The following picture illustrates the architecture described above.


In case of Kubernetes deployment we use only some of Spring Cloud components like Spring Cloud Feign or Sleuth without discovery or config server.

For similar examples of microservice applications with Spring Boot 2 you may refer to the repository https://github.com/piomin/sample-spring-microservices-new

sample-spring-microservices's People

Contributors

piomin avatar ramazansakin avatar prakhasaxena19 avatar

Watchers

angular-bull 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.