This is a small example demonstrate the use of Hystrix for third party dependencies in your application. The application is a REST API to convert currency from GBP or USD to INR. The third party service is being stubbed using wiremock returning a response with a fixed delay.
- Java 1.8
./gradlew clean createCapsule
./gradlew startServer
./gradlew stopServer
./gradlew startStubServer
./gradlew stopStubServer
Hystrix dashboard is a separate application that consumes hystrix event stream emitted from the application(Hystrix Example) and show the graph with current state of circuit.
- Add the hystrix dashboard war placed under ${projectDir}/dashboard to a tomcat container under /webapps.
- Start tomcat and goto http://localhost:7979
- Add the hystrix event stream of the application which is http://{hostname}:{port}/currencyConversionService/hystrix.stream to dashboard.
- Click on 'Monitor Streams' button.