File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -15,12 +15,15 @@ When you start your app, add:
1515Whenever you make an http request, add one or more of the hystrix-clj options to your options map:
1616
1717``` clj
18- (http/get " http://www.google.com" {:hystrix/command-key :default
19- :hystrix/fallback-fn default-fallback
20- :hystrix/group-key :default
21- :hystrix/threads 10
22- :hystrix/queue-size 5
23- :hystrix/timeout-ms 1000
18+ (http/get " http://www.google.com" {:hystrix/command-key :default
19+ :hystrix/fallback-fn default-fallback
20+ :hystrix/group-key :default
21+ :hystrix/threads 10
22+ :hystrix/queue-size 5
23+ :hystrix/timeout-ms 1000
24+ :hystrix/breaker-request-volume 20
25+ :hystrix/breaker-error-percent 50
26+ :hystrix/breaker-sleep-window-ms 5000
2427 :hystrix/bad-request-pred client-error?}}
2528```
2629Any values not supplied will be set to their default values as above. Requests with no Hystrix-related keys won't use Hystrix.
Original file line number Diff line number Diff line change 5050 (let [timeout (:hystrix/timeout-ms config 1000 )
5151 group (:hystrix/group-key config :default )
5252 threads (:hystrix/threads config 10 )
53+ request-volume (:hystrix/breaker-request-volume config 20 )
54+ error-percent (:hystrix/breaker-error-percent config 50 )
55+ sleep-window (:hystrix/breaker-sleep-window-ms config 5000 )
5356 command-configurator (doto (HystrixCommandProperties/Setter )
5457 (.withExecutionIsolationThreadTimeoutInMilliseconds timeout)
58+ (.withCircuitBreakerRequestVolumeThreshold request-volume)
59+ (.withCircuitBreakerErrorThresholdPercentage error-percent)
60+ (.withCircuitBreakerSleepWindowInMilliseconds sleep-window)
5561 (.withMetricsRollingPercentileEnabled false ))
5662 thread-pool-configurator (doto (HystrixThreadPoolProperties/Setter )
5763 (.withCoreSize threads)
You can’t perform that action at this time.
0 commit comments