public HystrixLocalConfigurationService(HystrixCommandIdentifier commandIdentifier, HystrixLocalOptions localOptions)
        {
            if (commandIdentifier == null)
            {
                throw new ArgumentNullException(nameof(commandIdentifier));
            }

            if (localOptions == null)
            {
                throw new ArgumentNullException(nameof(localOptions), "The option Details must be provided in order to use the HystrixLocalConfigurationService.");
            }

            options = localOptions.GetCommandOptions(commandIdentifier);
        }
Example #2
0
        public HystrixCommandOptions GetCommandOptions(string groupKey, string commandKey)
        {
            if (CommandGroups == null)
            {
                return(DefaultOptions ?? HystrixCommandOptions.CreateDefault());
            }

            if (!CommandGroups.TryGetValue(groupKey, out var groupCommands))
            {
                return(DefaultOptions ?? HystrixCommandOptions.CreateDefault());
            }

            if (!groupCommands.TryGetValue(commandKey, out var commandOptions))
            {
                return(DefaultOptions ?? HystrixCommandOptions.CreateDefault());
            }

            return(commandOptions);
        }
Example #3
0
        public HystrixCommandOptions GetCommandOptions(string groupKey, string commandKey)
        {
            if (CommandGroups == null)
            {
                return(HystrixCommandOptions.CreateDefault());
            }

            Dictionary <string, HystrixCommandOptions> groupCommands;

            if (!CommandGroups.TryGetValue(groupKey, out groupCommands))
            {
                return(HystrixCommandOptions.CreateDefault());
            }

            HystrixCommandOptions commandOptions;

            if (!groupCommands.TryGetValue(commandKey, out commandOptions))
            {
                return(HystrixCommandOptions.CreateDefault());
            }

            return(commandOptions);
        }