我正在尝试使用eureka和zuul的微服务。并且所有请求都存在问题,这需要超过1秒。据我所知,1秒是默认的hystrix超时,为了配置Zuul的超时,我必须配置这些属性:
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds
ribbon.ConnectTimeout
ribbon.ReadTimeout
但是当我设置它们时,Intelije Idea中的每个都有“无法解析配置属性......”的警告。而且,似乎它们没有应用而且不起作用。
答案已编辑
这样您将增加Hystrix超时(全局):
hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 5000
或按服务:
hystrix:
command:
<serviceName>:
execution:
isolation:
thread:
timeoutInMilliseconds: 5000