添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
苦闷的鞭炮  ·  新生儿脐茸 - 知乎·  2 年前    · 
酷酷的蜡烛  ·  Bloomberg Webinar·  2 年前    · 

I'm using Hystrix in a Spring Cloud application with commands defined like

@HystrixCommand(groupKey = "GroupKey", commandKey = "dummy",
        threadPoolProperties = {
                @HystrixProperty(name = "coreSize", value = "10")
public Observable<String> dummy() {
    return new ObservableResult<String>() {
        @Override
        public String invoke() {
            return "OK";

I want to update the coreSize (size of thread pool) property at runtime. How can that be done? Is it possible? Or should I look for different solution?

I've been reading about Archaius and how it's used for updating configurations but I don't understand how it can be used for what I'm trying to accomplish.

In my main class I'm using @EnableAutoConfiguration which adds ArchaiusAutoConfiguration to the application.

Thanks for any help!

Create a config.properties file for Archaius, containing the line

hystrix.threadpool.YOUR_GROUP_KEY.coreSize=10

Make sure that the file is on your application's classpath or explicitly configure the location in a JVM property, e.g.

-Darchaius.configurationSource.additionalUrls=file:///opt/myapp/config.properties

Archaius usually reads the file once a minute, so settings will be applied without application restart.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.

site design / logo © 2019 Stack Exchange Inc; user contributions licensed under cc by-sa 4.0 with attribution required. rev 2019.11.21.35463