# Microservices with Spring Cloud Advanced Demo Project [![Twitter](https://img.shields.io/twitter/follow/piotr_minkowski.svg?style=social&logo=twitter&label=Follow%20Me)](https://twitter.com/piotr_minkowski)
[![CircleCI](https://circleci.com/gh/piomin/sample-spring-microservices-new.svg?style=svg)](https://circleci.com/gh/piomin/sample-spring-microservices-new)
[![SonarCloud](https://sonarcloud.io/images/project_badges/sonarcloud-black.svg)](https://sonarcloud.io/dashboard?id=piomin_sample-spring-microservices-new)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=piomin_sample-spring-microservices-new&metric=bugs)](https://sonarcloud.io/dashboard?id=piomin_sample-spring-microservices-new)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=piomin_sample-spring-microservices-new&metric=coverage)](https://sonarcloud.io/dashboard?id=piomin_sample-spring-microservices-new)
[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=piomin_sample-spring-microservices-new&metric=ncloc)](https://sonarcloud.io/dashboard?id=piomin_sample-spring-microservices-new)
In 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.
-----
I'm publishing on my blog and maintaining example repositories just as a hobby. But if you feel it's worth donating:
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/piotrminkowski)
## 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](https://github.com/piomin/sample-spring-microservices-new/tree/master). A detailed guide may be find in the following article: [Quick Guide to Microservices with Spring Boot 2.0, Eureka and Spring Cloud](https://piotrminkowski.com/2018/04/26/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](https://github.com/piomin/sample-spring-microservices-new/tree/alibaba). A detailed guide may be find in the following article: [Microservices with Spring Cloud Alibaba](https://piotrminkowski.com/2018/11/15/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](https://github.com/piomin/sample-spring-microservices-new/tree/graphql). A detailed guide may be find in the following article: [GraphQL – The Future of Microservices?](https://piotrminkowski.com/2018/08/16/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](https://github.com/piomin/sample-spring-microservices-new/tree/openshift). A detailed guide may be find in the following article: [Running Java Microservices on OpenShift using Source-2-Image](https://piotrminkowski.com/2019/01/08/running-java-microservices-on-openshift-using-source-2-image/)
5. Using [Trampoline](http://ernestort.github.io/Trampoline/) for managing group of Spring Boot microservices locally. The example is available in the branch [trampoline](https://github.com/piomin/sample-spring-microservices-new/tree/trampoline). A detailed guide may be find in the following article: [Managing Spring Boot apps locally with Trampoline](https://piotrminkowski.com/2018/06/08/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](https://piotrminkowski.com/2023/03/13/microservices-with-spring-boot-3-and-spring-cloud/)
### Usage
Build the apps with images (we need ji for `config-service` since it contains `curl`):
```shell
$ mvn clean package -Pbuild-image
```
Then run all the containers with `docker-compose`:
```shell
$ 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.
<img src="https://piotrminkowski.files.wordpress.com/2018/04/spring-cloud-1.png" title="Architecture"><br/>
没有合适的资源?快使用搜索试试~ 我知道了~
Spring Boot 3 2 与 Spring Cloud 微服务示例项目.zip
共64个文件
java:27个
yml:19个
xml:7个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 85 浏览量
2024-11-15
22:43:28
上传
评论
收藏 41KB ZIP 举报
温馨提示
1、资源项目源码均已通过严格测试验证,保证能够正常运行; 2、项目问题、技术讨论,可以给博主私信或留言,博主看到后会第一时间与您进行沟通; 3、本项目比较适合计算机领域相关的毕业设计课题、课程作业等使用,尤其对于人工智能、计算机科学与技术等相关专业,更为适合; 4、下载使用后,可先查看README.md文件(如有),本项目仅用作交流学习参考,请切勿用于商业用途。
资源推荐
资源详情
资源评论
收起资源包目录
Spring Boot 3 2 与 Spring Cloud 微服务示例项目.zip (64个子文件)
sample-spring-microservices-new
pom.xml 2KB
discovery-service
pom.xml 3KB
src
main
resources
application.yml 252B
java
pl
piomin
services
discovery
DiscoveryApplication.java 463B
.gitignore 47B
renovate.json 394B
.circleci
config.yml 456B
readme.md 6KB
docker-compose.yml 2KB
gateway-service
pom.xml 3KB
src
main
resources
application.yml 250B
java
pl
piomin
services
gateway
GatewayApplication.java 2KB
.gitignore 47B
organization-service
pom.xml 5KB
src
test
java
pl
piomin
services
organization
OrganizationControllerTests.java 1KB
OrganizationRepositoryTest.java 1KB
main
resources
application.yml 255B
java
pl
piomin
services
organization
OrganizationApplication.java 1KB
repository
OrganizationRepository.java 694B
client
EmployeeClient.java 538B
DepartmentClient.java 731B
controller
OrganizationController.java 3KB
model
Department.java 823B
Organization.java 1KB
Employee.java 918B
.gitignore 47B
config-service
pom.xml 2KB
src
main
resources
application.yml 223B
config
employee-service.yml 772B
department-service-docker.yml 508B
department-service.yml 695B
gateway-service-docker.yml 2KB
discovery-service-docker.yml 355B
organization-service.yml 697B
employee-service-docker.yml 551B
discovery-service.yml 468B
gateway-service.yml 1KB
employee-service-instance2.yml 428B
organization-service-docker.yml 510B
java
pl
piomin
services
config
ConfigApplication.java 446B
Dockerfile 215B
.gitignore 47B
Jenkinsfile 726B
.gitignore 24B
employee-service
pom.xml 5KB
src
test
java
pl
piomin
services
employee
EmployeeRepositoryTest.java 2KB
EmployeeAppTests.java 2KB
main
resources
application.yml 251B
java
pl
piomin
services
employee
repository
EmployeeRepository.java 1KB
EmployeeApplication.java 2KB
controller
EmployeeController.java 2KB
model
Employee.java 1KB
.gitignore 47B
department-service
pom.xml 5KB
src
test
java
pl
piomin
services
department
DepartmentAppTests.java 2KB
DepartmentRepositoryTest.java 2KB
main
resources
application.yml 253B
java
pl
piomin
services
department
repository
DepartmentRepository.java 844B
client
EmployeeClient.java 524B
controller
DepartmentController.java 2KB
DepartmentApplication.java 1KB
model
Department.java 1KB
Employee.java 916B
.gitignore 47B
共 64 条
- 1
资源评论
pk_xz123456
- 粉丝: 2159
- 资源: 1837
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- (源码)基于C语言的Haribote操作系统项目.zip
- (源码)基于Spring Boot框架的秒杀系统.zip
- (源码)基于Qt框架的待办事项管理系统.zip
- 将 Java 8 的 lambda 表达式反向移植到 Java 7、6 和 5.zip
- (源码)基于JavaWeb的学生管理系统.zip
- (源码)基于C++和Google Test框架的数独游戏生成与求解系统.zip
- 学生提交的 JavaScript 20 项目.zip
- (源码)基于Blynk IOT框架的自动化继电器控制系统.zip
- (源码)基于Qt和SQLite的餐馆管理系统.zip
- (源码)基于Java和Qt的酒店温控计费系统.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功