this is an example of hystrix-go usage in web dev
this example contains 2 service:
-
alpha
as our main service, circuit breaker are in place there- there are 2 api
/ping-a
andping-b
, both will do the same thing, with the only difference is, /ping-a
will not be using circuit breaker/ping-b
will be using circuit breaker
- there are 2 api
-
zulu
as our secondary/dummy service for external service- there is 1 api
/ping
that we will use as dummy endpoint
- there is 1 api
- run service
alpha
- hit one of
alpha
's endpoint alpha
will callzulu
's endpoint/ping
zulu
return x toalpha
alpha
return x to the requester
- you need to run both separately
- run alpha from root folder
go run alpha/main.go
- run zulu from root folder
go run zulu/main.go
further explanation will be added