优化hystrix熔断器线程池

This commit is contained in:
ajaxfan
2021-05-19 16:09:52 +08:00
parent 2c97400300
commit e6e0cd268f
2 changed files with 10 additions and 4 deletions

View File

@ -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
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

View File

@ -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);