Code Monkey home page Code Monkey logo

eureka-hystrix-dotnetcore's Introduction

Using Netflix/Hystrix with .NET Core Applications

Repository has these applications;

/eureka -> Use the Service Registry to dynamically discover and call registered services. Developed by Netflix.

/hystrix-dashboard -> A latency and fault tolerance library. Developed by Netflix.

/custom-sample-api -> Provides sample data and registered to eureka. Can be called any application which fetchs registered services from it as http://remote-service.

/custom-sample-ui -> Circuit breaker pattern is implemented. All metrics can be discovered with Hystrix Dashboard. It calls custom-sample-api.

Requirements:

  • JDK 1.8
  • Apache Maven 3.5.4
  • dotnet 2.1

Run

Eureka

cd /eureka
mvn -N io.takari:maven:wrapper
./mvnw spring-boot:run

Hystrix Dashboard

cd /hystrix-dashboard
mvn install
java -jar target/hystrix-dashboard-0.0.1.BUILD-SNAPSHOT.jar

Sample API

cd /custom-sample-api
dotnet run

Sample UI

cd /custom-sample-ui
dotnet run

Tests

Start UI application and run while true; do sleep 1; curl -s http://localhost:1923/api/home;echo -e '\r';done on terminal. Note: API is not running yet!

After executes less than 10 requests (circuitBreaker:RequestVolumeThreshold, default to 20) in 10 seconds (metrics:rollingStats:timeInMilliseconds, default to 10000 seconds), there won't be any decision to change the status. If fulfills the minimum threshold requirement and more than 80% of requests have failed (circuitBreaker:errorThresholdPercentage, default to 50), Hystrix will decide to open the Circuit Breaker.

When you see

Circuit Open

message on http://localhost:7979/hystrix/monitor?stream=http://localhost:1923/hystrix/hystrix.stream run the API immediately and wait until status changes!

Credits

eureka-hystrix-dotnetcore's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  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.