Upgrade to Pro — share decks privately, control downloads, hide ads and more …

CircuitBreakerの適用

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
Avatar for Yoshitomo Hayashi Yoshitomo Hayashi
February 28, 2017
1.7k

 CircuitBreakerの適用

Avatar for Yoshitomo Hayashi

Yoshitomo Hayashi

February 28, 2017
Tweet

Transcript

  1. マーティン・ファウラー氏のブログ( https://martinfowler.com/bliki/CircuitBreaker.html) OSSの実装 - Java - https://github.com/Netflix/Hystrix - https://github.com/Comcast/jrugged -

    Scala - https://github.com/FaKod/Circuit-Breaker-for-Scala - Ruby - https://github.com/wsargent/circuit_breaker/tree/master CircuitBreakerとは
  2. 使用例 if (circuitBreaker.allowRequest()) { try { // invoke remote service

    circuitBreaker.onSuccess(); } catch (Exception e) { circuitBreaker.onFailure(); } } else { // CircuitBreaker OPEN }
  3. 設定値 // 処理を開始する最小リクエスト数 private Integer requestVolumeThreshold; // OPENとなるエラー率 private Integer

    errorThresholdPercentage; // エラー率をチェックするデータの期間 private Integer checkDurationSecond; // OPENからHALF_OPENとなるまでの期間 private Integer openDurationSecond;