Skip to content

Spring Cloud 系列(九)Hystrix源码中问答环节 dynamic.hystrix.command.timeout 不生效的问题 #8

@justintuition

Description

@justintuition

调试了下源码,确实是小马哥说的缓存的问题,只不过是通过 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions