https://github.com/cepr0/sb-consul-demo
https://github.com/cepr0/sb-consul-demo
k6 load-balancing microservices service-discovery spring-boot spring-cloud-consul traefik
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cepr0/sb-consul-demo
- Owner: Cepr0
- Created: 2020-05-10T11:43:24.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-11T11:26:59.000Z (about 6 years ago)
- Last Synced: 2025-06-17T11:02:34.204Z (12 months ago)
- Topics: k6, load-balancing, microservices, service-discovery, spring-boot, spring-cloud-consul, traefik
- Language: Java
- Size: 11.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## Spring Boot microservices with Consul cluster and Traefik
Demo of working Spring Boot microservices with [Consul](https://www.consul.io/) cluster, for service discovering, and
[Traefik](https://docs.traefik.io/) for external automatic and dynamic routing and load balancing.
1. Build project
```
mvn clean package
```
2. Run Consul cluster and Traefik
```
docker-compose up -d
```
3. Run microservices (two instances per service)
```
docker-compose -f services-compose.yml up -d --scale first-service=2 --scale second-service=2 --build
```
4. Watch how they 'talk' with each other:
```
docker-compose -f services-compose.yml logs -f
```
5. Run external requests
- manually:
```
curl 'http://localhost/demo/one'
curl 'http://localhost/demo/two'
```
- or with [k6](https://k6.io/)
```
k6 run src/test/js/load-test.js --duration 1m
```
Then watch reflection of their work in the logs.
6. Stop the environment
```
docker-compose -f services-compose.yml down
docker-compose down
```