Support configuration per command group
Currently, configuration settings like command properties can only be configured either globally or per command. This makes it difficult to configure, say, command timeouts per service without manually adding configuration settings for every command or programmatically loading common settings during HystrixCommand construction.
Proposal: an additional level of properties should be supported, hystrix.command.HystrixCommandGroupKey...., which overrides the global settings, but gets overridden by command-specific settings.
Would really like this feature as this makes maintaining configuration way more easy.
This functionality is still actual in 2020
@Liroyd Hystrix is in maintenance mode since Nov 2018.
If it helps, I implemented hardcoded per-command-group defaults by adding them to my enum that extends HystrixCommandGroupKey. Just add a member of type HystrixCommandProperties.Setter. Then use a factory method to build your HystrixCommand instances, pass it a HystrixCommand.Setter where you can call andCommandPropertiesDefaults and pass the HystrixCommandProperties.Setter from your enum.
For a more concrete example, suppose your custom enum had class CommandGroupKey and the member had a getter getCommandPropertiesDefaults, then your factory method would look like:
public static <T> HystrixCommand<T> create(CommandGroupKey commandGroup, String commandKey, Callable<T> callable) {
HystrixCommand.Setter setter = HystrixCommand.Setter
.withGroupKey(commandGroup)
.andCommandKey(HystrixCommandKey.Factory.asKey(commandKey));
if (commandGroup.getCommandPropertiesDefaults() != null) {
setter = setter.andCommandPropertiesDefaults(commandGroup.getCommandPropertiesDefaults());
}
return new HystrixCommand<T>(setter) {
@Override
protected T run() throws Exception {
return callable.call();
}
};
}
This doesn't solve the problem of dynamic config but you could probably look up some documentation on Archaius and come up with a solution to that if you needed it. We ended up finding these hardcoded settings sufficient for our purposes.