Hystrix + Feign + Spring Boot
Example of hystrix
with feign
usage in Spring Boot
Used Docker to containerize environment.
hello world service
is unavailable/returns an error, it uses fallback (fixed, fake response from hello world service
)requestVolumeThreshold: 5
and sleepWindowInMilliseconds: 300000
. When 5 requests fails to hello world service
it will use fallback for the next 5 minutes without making any request to hello world service.hello world service
, this response is returned: hello world from hello-world service
, if it uses the fallback: hello world from example-service
Docker
and docker-compose
installed.Docker CE INSTALLATION
Docker Compose INSTALLATION
docker-compose build
docker-compose up
hello world service
to test hystrix
:docker-compose stop hello-world-service
hello-world-service
again:docker-compose up hello-world-service
hello-world-service
or use fallback and return a string.