Hystrix playground.
lein ring server
Then you can test Hystrix behavior using:
curl -H "Content-Type: application/json" -d '{"n": 10}' -X GET http://localhost:3001/api/ping
n
here means the app will hit an online JSON server to retrieve n
number
of posts' title, and send back to the client. The response will have different failures, including 404, timeout etc.
lein test
The event stream is exposed at localhost:3000/hystrix.stream, to view these stream on Hystrix dashboard, follow the instructions here to start the dashboard.
lein do clean, ring uberjar
java -jar target/try-hystrix.jar
lein ring uberwar
Copyright © Mengxi Lu