Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring Cloud教程 - Hystrix运行时动态修改配置 #17

Open
TFdream opened this issue Jul 20, 2020 · 0 comments
Open

Spring Cloud教程 - Hystrix运行时动态修改配置 #17

TFdream opened this issue Jul 20, 2020 · 0 comments

Comments

@TFdream
Copy link
Owner

TFdream commented Jul 20, 2020

Hystrix默认使用Archaius 来实现的动态配置,我们在上节中,使用了代码的方式来实现配置,这节,我们使用Hystrix的动态配置来实现。

超时时间

1、Hystrix配置整体的超时时间

hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=1000

2、配置单个超时时间

hystrix.command.HystrixCommandKey.execution.isolation.thread.timeoutInMilliseconds=1000
hystrix.command.HystrixCommandKey.execution.isolation.strategy = SEMAPHORE

其中HystrixCommandKey为@HystrixCommand 注解中的commandKey。

@HystrixCommand(groupKey = "StoreSubmission", commandKey = "StoreSubmission", threadPoolKey = "StoreSubmission")
public String storeSubmission(ReturnType returnType, InputStream is, String id) {
}

@TFdream TFdream changed the title Spring Cloud教程 - Hystrix参数动态配置 Spring Cloud教程 - Hystrix运行时动态修改配置 Jul 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant