调试了下源码,确实是小马哥说的缓存的问题,只不过是通过 HystrixCommandKey 检查缓存,不是 HystrixThreadPoolKey,估计是视频时间紧搞错了。另外,自定义 dynamic.hystrix.command.timeout 属性的方法实现较为繁琐,而官方文档 Configuration 其实已经提供了相应的属性设置:hystrix.command.xxx.execution.isolation.thread.timeoutInMilliseconds(“xxx” 就是 HystrixCommandKey.name()),我们只需设置和修改这个属性值即可。(两种方式的具体实现:https://github.com/justinstuition/0300_Spring_Cloud/tree/master/0712_springcloud_hystrix/05_hystrixcommand-timout-dynamicsetting/src