https://github.com/slamdev/resilience-workshop
https://github.com/slamdev/resilience-workshop
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/slamdev/resilience-workshop
- Owner: slamdev
- Created: 2020-07-08T16:09:14.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T17:40:26.000Z (about 2 years ago)
- Last Synced: 2025-01-29T14:45:16.477Z (about 1 year ago)
- Language: Java
- Size: 88.9 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Resilience Workshop
## Patterns
### CircuitBreaker
1. Run **generate-base-load** test and demonstrate stable RPS
2. Run **call-delayed-error** test and explain why RPS goes down
3. Put `@io.github.resilience4j.circuitbreaker.annotation.CircuitBreaker(name = "delayedError")` on top of `delayedError` method and demonstrate how RPS is stabilizing.
#### Cleanup
1. Drop **call-delayed-error** job and restart **service-under-test** deployment
### Retry
1. Run **call-random-error** test and demonstrate 5xx and 2xx responses rate
2. Put `@io.github.resilience4j.retry.annotation.Retry(name = "randomError")` on top of `randomError` method and demonstrate 2xx only responses
#### Cleanup
1. Drop **call-random-error** job and restart **service-under-test** deployment
### Bulkhead
1. Run **call-slow-db-query** test and demonstrate stable RPS and connection pool metrics
2. Run **generate-db-entries** test and explain why connection pool is full
3. Put `@io.github.resilience4j.bulkhead.annotation.Bulkhead(name = "slowDbQuery")` on top of `slowDbQuery` method and demonstrate how connection pool is stabilizing.
#### Cleanup
1. Drop **call-slow-db-query** job and restart **service-under-test** deployment
### Pubsub
1. Run **generate-pubsub-messages** test and explain how default pubsub 10s retry works
## Helpful scripts
```shell script
kubectl port-forward -nresilience-workshop svc/pubsub-emulator 8085
kubectl port-forward -nresilience-workshop svc/mongodb 27017
kubectl port-forward -nresilience-workshop svc/faulty-service 8181:80
curl -H 'content-type: application/json' -X POST --data $'{"messages": [{"data": "abcd"}]}' http://localhost:8085/v1/projects/fake/topics/sample-topic:publish
mongo "mongodb://user:pass@localhost:27017/resilience-workshop" --eval 'db.sample.insert({ _id : ObjectId(), name : "test" })'
mongo "mongodb://user:pass@localhost:27017/resilience-workshop" --eval 'db.sample.find()'
```