From e6e0cd268f99f5dc0fe96dab61697f7975bb149c Mon Sep 17 00:00:00 2001 From: ajaxfan <909938737@qq.com> Date: Wed, 19 May 2021 16:09:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96hystrix=E7=86=94=E6=96=AD?= =?UTF-8?q?=E5=99=A8=E7=BA=BF=E7=A8=8B=E6=B1=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/feign-configuration.properties | 12 ++++++++---- .../mall/ebtp/common/config/FeignConfig.java | 2 ++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/mall-ebtp-cloud-feign-starter/src/main/resources/feign-configuration.properties b/mall-ebtp-cloud-feign-starter/src/main/resources/feign-configuration.properties index 59b576d..d20b19c 100644 --- a/mall-ebtp-cloud-feign-starter/src/main/resources/feign-configuration.properties +++ b/mall-ebtp-cloud-feign-starter/src/main/resources/feign-configuration.properties @@ -3,7 +3,11 @@ feign.hystrix.enabled=true feign.client.config.default.connectTimeout=200000 feign.client.config.default.readTimeout=200000 -# 熔断器线程池配置 -hystrix.threadpool.default.coreSize=1000 -hystrix.threadpool.default.maxQueueSize=3000 -hystrix.threadpool.default.queueSizeRejectionThreshold=3000 \ No newline at end of file +hystrix.threadpool.default.coreSize=100 +hystrix.threadpool.default.maximumSize=300 +hystrix.threadpool.default.maxQueueSize=1000 +hystrix.threadpool.default.queueSizeRejectionThreshold=1000 +hystrix.threadpool.default.allowMaximumSizeToDivergeFromCoreSize=true + +hystrix.command.default.execution.isolation.strategy=THREAD +hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=20000 diff --git a/uboot-common/src/main/java/com/chinaunicom/mall/ebtp/common/config/FeignConfig.java b/uboot-common/src/main/java/com/chinaunicom/mall/ebtp/common/config/FeignConfig.java index bcc1487..364dc2b 100644 --- a/uboot-common/src/main/java/com/chinaunicom/mall/ebtp/common/config/FeignConfig.java +++ b/uboot-common/src/main/java/com/chinaunicom/mall/ebtp/common/config/FeignConfig.java @@ -41,6 +41,8 @@ public class FeignConfig implements RequestInterceptor { public void apply(RequestTemplate template) { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); + System.out.println(attributes); + if (Objects.nonNull(attributes)) { if (isNonExistsWhiteList(template.url())) { injectToken(template, attributes);