Coder Social home page Coder Social logo

xiaozan-dev / hystrix-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kevinpotgieter/hystrix-demo

0.0 1.0 0.0 23 KB

A sample repo to demonstrate how hystrix works as well as the threads that the commands execute on under different conditions.

License: MIT License

Java 100.00%

hystrix-demo's Introduction

hystrix-demo

A sample application which goes some way to highlighting which threads execution occurs on depending on the failure scenario.

This demo hopes to also demonstrate the effect structuring your Hystrix Commands has on your overall execution time.

Unless specifically set in the start of the test, all Hystrix default configuration is used. i.e. 1000ms command timeout. Defaults described here

See more on the accompanying blog post here

Scenarios

All scenarios can be executed via tests in HystrixControllerTest

  1. Immediate failure in run() and slow execution in fallback to simulate IO blocking call in fallback()
  2. Slow run() which results in timing out, and fallback() return immediately
  3. Slow run() which results in timing out, as well as a slow fallback()
  4. Slow run() which results in timing out, and a deterministic fallback() by means of wrapping the call in a HystrixCommand
  5. Slow run() which results in timing out, and a fallback() which will execute on calling thread by means of some lambda magic

IntelliJ IDEA users

Installing the GrepConsole plugin is suggested if you would like to follow along with the diagram in the blog post mentioned above. The below grep console configuration will highlight the appropriate thread executions which correlate to the diagram.

Diagram from blog: ![Diagram from blog] (https://kevinpotgieter.files.wordpress.com/2016/10/hystrix-thread-execution.jpg)

GrepConsole configuration: ![GrepConsole configuration] (https://kevinpotgieter.files.wordpress.com/2016/10/screen-shot-2016-10-31-at-09-34-30.png)

hystrix-demo's People

Contributors

kevinpotgieter avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.