Closed jerryxh closed 5 years ago
Hi @jerryxh , sorry about the delay!
Here is the entire code of the initializeCommand method:
public function initializeConfig(Config $phystrixConfig)
{
$commandKey = $this->getCommandKey();
$config = new Config($phystrixConfig->get('default')->toArray(), true);
if ($phystrixConfig->__isset($commandKey)) {
$commandConfig = $phystrixConfig->get($commandKey);
$config->merge($commandConfig);
}
$this->config = $config;
}
as you can see, it will merge command-specific configuration with the default one IF command-specific configuration is available.
I hope that helps! If you can't get it working please re-open or file a new ticket with some more information about how to reproduce and I will take a look.
I can confirm that we use this feature and it definitely works!
Per the Phystrix README page, you should be able to add a custom, command-specific configuration (eg,
'MyCommand' => array('queryServices' => array( 'timeout' => 10) )
) to the configuration array and access it in the run() method of the MyCommand class (which extends AbstractClass) as follows:However, this is not possible because the following line in the initializeConfig() method of the AbstractClass class restricts the configuration to the "default" configuration:
This should either be fixed or rectified in the documentation.