我遇到了同樣的問題,我嘗試覆蓋application.yaml中的hystrix屬性。當我運行應用程序&檢查屬性localhost:端口/應用程序上下文/ hystrix.stream,我得到所有的默認值,而不是。在Spring-Boot應用程序中使用application.yaml配置hystrix命令屬性
這裏是我的application.yaml紅椎配置
hystrix:
command.StoreSubmission.execution.isolation.thread.timeoutInMilliseconds: 30000
command.StoreSubmission.circuitBreaker.requestVolumeThreshold: 4
command.StoreSubmission.circuitBreaker.sleepWindowInMilliseconds: 60000
command.StoreSubmission.metrics.rollingStats.timeInMilliseconds: 180000
collapser.StoreSubmission.maxRequestsInBatch: 1
collapser.StoreSubmission.requestCache.enabled: FALSE
threadpool.StoreSubmission.coreSize: 30
threadpool.StoreSubmission.metrics.rollingStats.timeInMilliseconds: 180000
這是我看到的時候我打的網址 - 本地主機:端口/應用程序上下文中的瀏覽器/ hystrix.stream [這是相同的流用於錐儀表板]的url -
data: {"type":"HystrixCommand","name":"storeSubmission","group":"StoreSubmission","currentTime":1435941064801,"isCircuitBreakerOpen":false,"errorPercentage":0,"errorCount":0,"requestCount":0,"rollingCountCollapsedRequests":0,"rollingCountExceptionsThrown":0,"rollingCountFailure":0,"rollingCountFallbackFailure":0,"rollingCountFallbackRejection":0,"rollingCountFallbackSuccess":0,"rollingCountResponsesFromCache":0,"rollingCountSemaphoreRejected":0,"rollingCountShortCircuited":0,"rollingCountSuccess":0,"rollingCountThreadPoolRejected":0,"rollingCountTimeout":0,"currentConcurrentExecutionCount":0,"latencyExecute_mean":0,"latencyExecute":{"0":0,"25":0,"50":0,"75":0,"90":0,"95":0,"99":0,"99.5":0,"100":0},"latencyTotal_mean":0,"latencyTotal":{"0":0,"25":0,"50":0,"75":0,"90":0,"95":0,"99":0,"99.5":0,"100":0},"propertyValue_circuitBreakerRequestVolumeThreshold":20,"propertyValue_circuitBreakerSleepWindowInMilliseconds":5000,"propertyValue_circuitBreakerErrorThresholdPercentage":50,"propertyValue_circuitBreakerForceOpen":false,"propertyValue_circuitBreakerForceClosed":false,"propertyValue_circuitBreakerEnabled":true,"propertyValue_executionIsolationStrategy":"THREAD","propertyValue_executionIsolationThreadTimeoutInMilliseconds":1000,"propertyValue_executionIsolationThreadInterruptOnTimeout":true,"propertyValue_executionIsolationThreadPoolKeyOverride":null,"propertyValue_executionIsolationSemaphoreMaxConcurrentRequests":10,"propertyValue_fallbackIsolationSemaphoreMaxConcurrentRequests":10,"propertyValue_metricsRollingStatisticalWindowInMilliseconds":10000,"propertyValue_requestCacheEnabled":true,"propertyValue_requestLogEnabled":true,"reportingHosts":1}
data: {"type":"HystrixThreadPool","name":"StoreSubmission","currentTime":1435941064801,"currentActiveCount":0,"currentCompletedTaskCount":35,"currentCorePoolSize":30,"currentLargestPoolSize":30,"currentMaximumPoolSize":30,"currentPoolSize":30,"currentQueueSize":0,"currentTaskCount":35,"rollingCountThreadsExecuted":0,"rollingMaxActiveThreads":0,"propertyValue_queueSizeRejectionThreshold":5,"propertyValue_metricsRollingStatisticalWindowInMilliseconds":180000,"reportingHosts":1}
問題是與錐命令&崩塌性質,其中作爲線程池屬性設置是否正確。我有以下我@Configuration類註釋 -
@EnableAutoConfiguration(exclude=MongoAutoConfiguration.class)
@EnableHystrix
@EnableHystrixDashboard
曾有人試圖在thier春啓動應用程序使用application.yaml配置椎命令屬性,可以幫助嗎?
我在看這個,並注意來自HystrixCommand數據的名字是小寫,你的配置是大寫。 – spencergibb
我將你的值粘貼到我的'application.yml'中,並且這些值已經通過。 – spencergibb
@spencergibb:1.通過HystrixCommand數據傳入的名稱是由HystrixCommand包裝的方法名稱。 2.在配置其groupKey值時,實際上應該是commandKey值。 3.當你說這些值出現時,在哪裏? – Amrut