- Clone the repo and
cd api-based-resiliency/pay-bill-resilience-service
go mod download
docker-cmopose up
127.0.0.1:8000/api/update-biller-health
with POST req body{ "biller_1": "UP", "biller_2": "DOWN", "biller_3": "UP" }
127.0.0.1:8000/api/get-biller-status?code=biller_2
, GET req
- When you are hitting the POST request the matrix will be stored in the Redis with a TTL. It's described in the file,
pay-bill-resilience-service
. - When you are making a GET request to get the status of a specific code, it will collect the matrix from the Redis and send it back to you. It's described in the file,
biller-status.go
- If no entry is found in Redis, or if there is any error a default value
UP
will be sent.
If you are in Layer 0
and wants to know the health status of Layer 2
and if there is no circuit breaker in Layer 1
then this approach is helpful.
- gin-gonic: Used in Transport layer
- redi-go: redis client in go