优化hystrix熔断器线程池
This commit is contained in:
@ -3,7 +3,11 @@ feign.hystrix.enabled=true
|
|||||||
feign.client.config.default.connectTimeout=200000
|
feign.client.config.default.connectTimeout=200000
|
||||||
feign.client.config.default.readTimeout=200000
|
feign.client.config.default.readTimeout=200000
|
||||||
|
|
||||||
# 熔断器线程池配置
|
hystrix.threadpool.default.coreSize=100
|
||||||
hystrix.threadpool.default.coreSize=1000
|
hystrix.threadpool.default.maximumSize=300
|
||||||
hystrix.threadpool.default.maxQueueSize=3000
|
hystrix.threadpool.default.maxQueueSize=1000
|
||||||
hystrix.threadpool.default.queueSizeRejectionThreshold=3000
|
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
|
||||||
|
@ -41,6 +41,8 @@ public class FeignConfig implements RequestInterceptor {
|
|||||||
public void apply(RequestTemplate template) {
|
public void apply(RequestTemplate template) {
|
||||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||||
|
|
||||||
|
System.out.println(attributes);
|
||||||
|
|
||||||
if (Objects.nonNull(attributes)) {
|
if (Objects.nonNull(attributes)) {
|
||||||
if (isNonExistsWhiteList(template.url())) {
|
if (isNonExistsWhiteList(template.url())) {
|
||||||
injectToken(template, attributes);
|
injectToken(template, attributes);
|
||||||
|
Reference in New Issue
Block a user