像这样设置默认超时
hystrix:
threadpool:
default:
coreSize: 500
maxQueueSize: 1000
queueSizeRejectionThreshold: 800
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 30000
丝带:
ribbon:
eager-load:
enabled: true
clients: dcit-auth,dcit-service-upms,dcmd-service-demand
Httpclient:
enabled: false
OkHttp:
enabled: true
ReadTimeout: 30000
ConnectTimeout: 30000
假装:
feign:
hystrix:
enabled: true
okhttp:
enabled: true
httpclient:
enabled: false
client:
config:
feignName:
connectTimeout: 30000
readTimeout: 30000
compression:
request:
enabled: true
response:
enabled: true
我的服务的hystrix模因:
“ gauge.servo.hystrix.hystrixcommand.ribboncommand.myservice.propertyvalue_executiontimeoutinmilliseconds”:2000,
每次myservice响应超过2秒将返回500超时错误。
为什么不设置超时设置?
答案 0 :(得分:1)
我认为您遇到了假冒超时。 使用feign.client.config。默认代替feign.client.config。 feignName 来定义应用程序中所有Feign客户端的名称。