{"id":16119866,"url":"https://github.com/piomin/sample-spring-microservices","last_synced_at":"2025-10-23T15:30:39.876Z","repository":{"id":39121644,"uuid":"80814970","full_name":"piomin/sample-spring-microservices","owner":"piomin","description":"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","archived":true,"fork":false,"pushed_at":"2024-02-19T20:26:20.000Z","size":111,"stargazers_count":598,"open_issues_count":11,"forks_count":965,"subscribers_count":29,"default_branch":"master","last_synced_at":"2024-10-10T20:55:12.053Z","etag":null,"topics":["elastic-stack","eureka","hystrix","kibana","kubernetes","logstash","microservices","ribbon","spring-boot","spring-boot-admin","spring-cloud","spring-cloud-netflix","spring-cloud-sleuth","zipkin","zuul"],"latest_commit_sha":null,"homepage":"https://piotrminkowski.wordpress.com/","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/piomin.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-03T09:25:56.000Z","updated_at":"2024-10-08T18:20:50.000Z","dependencies_parsed_at":"2022-07-12T17:43:51.622Z","dependency_job_id":null,"html_url":"https://github.com/piomin/sample-spring-microservices","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piomin%2Fsample-spring-microservices","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piomin%2Fsample-spring-microservices/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piomin%2Fsample-spring-microservices/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piomin%2Fsample-spring-microservices/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/piomin","download_url":"https://codeload.github.com/piomin/sample-spring-microservices/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237843894,"owners_count":19375224,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elastic-stack","eureka","hystrix","kibana","kubernetes","logstash","microservices","ribbon","spring-boot","spring-boot-admin","spring-cloud","spring-cloud-netflix","spring-cloud-sleuth","zipkin","zuul"],"created_at":"2024-10-09T20:55:19.513Z","updated_at":"2025-10-23T15:30:39.558Z","avatar_url":"https://github.com/piomin.png","language":"Java","readme":"# Microservices with Spring Cloud Demo Project [![Twitter](https://img.shields.io/twitter/follow/piotr_minkowski.svg?style=social\u0026logo=twitter\u0026label=Follow%20Me)](https://twitter.com/piotr_minkowski)\r\n\r\nIn this project I'm demonstrating you the most interesting features of [Spring Cloud Project](https://spring.io/projects/spring-cloud) for building microservice-based architecture. Most of examples are based on **Spring Boot 1.5**.\r\n\r\n\u003e :warning: This repository contains examples of Spring Boot 1.5 and won't be updated. **If you are looking for the repository with the latest versions of Spring Boot/Spring Cloud please refer to that: https://github.com/piomin/sample-spring-microservices-new**. It is automatically updated to the latest versions of all frameworks and libraries.\r\n\r\n## Getting Started \r\nCurrently 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:\r\n1. 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](https://github.com/piomin/sample-spring-microservices/tree/master). A detailed description can be found here: [Part 1: Creating microservice using Spring Cloud, Eureka and Zuul](https://piotrminkowski.com/2017/02/05/part-1-creating-microservice-using-spring-cloud-eureka-and-zuul/)\r\n2. 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](https://github.com/piomin/sample-spring-microservices/tree/logstash). A detailed description can be found here: [Part 2: Creating microservices – monitoring with Spring Cloud Sleuth, ELK and Zipkin](https://piotrminkowski.com/2017/04/05/part-2-creating-microservices-monitoring-with-spring-cloud-sleuth-elk-and-zipkin/)\r\n3. 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](https://github.com/piomin/sample-spring-microservices/tree/hystrix). A detailed description can be found here: [Part 3: Creating Microservices: Circuit Breaker, Fallback and Load Balancing with Spring Cloud](https://piotrminkowski.com/2017/05/15/part-3-creating-microservices-circuit-breaker-fallback-and-load-balancing-with-spring-cloud/)\r\n4. Using tool **Spring Boot Admin** for managing and monitoring microservices-based system. The example is available in the branch [admin](https://github.com/piomin/sample-spring-microservices/tree/admin). A detailed description can be found here: [Monitoring Microservices With Spring Boot Admin](https://piotrminkowski.com/2017/06/26/monitoring-microservices-with-spring-boot-admin/)\r\n5. 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](https://github.com/piomin/sample-spring-microservices/tree/kubernetes). A detailed description can be found here: [Microservices with Kubernetes and Docker](https://piotrminkowski.com/2017/03/31/microservices-with-kubernetes-and-docker) \r\n\r\n\r\n### Usage\r\n\r\nIn 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.  \r\n\r\n### How to Run\r\n\r\ndocker-compose up\r\n\r\nIf you want to change anything on any service(s), you need to build the service(s) you changed and then :\r\n\r\ndocker-compose build\r\ndocker-compose up\r\n\r\n### How to Run\r\n\r\ndocker-compose down\r\n\r\n## Architecture\r\n\r\nOur sample microservices-based system consists of the following modules:\r\n- **gateway-service** - a module that Spring Cloud Netflix Zuul for running Spring Boot application that acts as a proxy/gateway in our architecture.\r\n- **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.\r\n- **discovery-service** - a module that depending on the example it uses Spring Cloud Netflix Eureka as an embedded discovery server.\r\n- **account-service** - a module containing the first of our sample microservices that allows to perform CRUD operation on in-memory repository of accounts\r\n- **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. \r\n- **zipkin-service** - a module that runs embedded Zipkin instance.\r\n\r\nThe following picture illustrates the architecture described above.\r\n\r\n\u003cimg src=\"https://piotrminkowski.files.wordpress.com/2017/02/san1s57hfsas5v53ms53.png\" title=\"Architecture\"/\u003e\u003cbr/\u003e\r\n\r\nIn case of Kubernetes deployment we use only some of Spring Cloud components like Spring Cloud **Feign** or **Sleuth** without discovery or config server.\r\n\r\n\u003cimg src=\"https://piotrminkowski.files.wordpress.com/2017/03/kube_micro.png?w=768\u0026h=528\" title=\"Kube\"/\u003e\r\n\r\nFor similar examples of microservice applications with Spring Boot 2 you may refer to the repository https://github.com/piomin/sample-spring-microservices-new\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiomin%2Fsample-spring-microservices","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiomin%2Fsample-spring-microservices","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiomin%2Fsample-spring-microservices/lists"}