public virtual ILoadBalancer Create(LoadBalancerConfiguration configuration, [NotNull] string service) { var serviceDiscoveryProvider = ServiceProvider.GetRequiredService <IServiceDiscoveryProvider>(); var noLoadBalancerConfiguration = configuration.GetNoLoadBalancerConfiguration(); var noLoadBalancer = new NoLoadBalancer(service, noLoadBalancerConfiguration, serviceDiscoveryProvider); return(noLoadBalancer); }
public ILoadBalancer Create(LoadBalancerConfiguration configuration, [NotNull] string service) { var serviceDiscoveryProvider = ServiceProvider.GetRequiredService <IServiceDiscoveryProvider>(); var randomLoadBalancerConfiguration = configuration.GetRandomConfiguration(); var randomLoadBalancer = new RandomLoadBalancer(service, randomLoadBalancerConfiguration, serviceDiscoveryProvider); return(randomLoadBalancer); }
public static object GetConfiguration( [NotNull] this LoadBalancerConfiguration containerConfiguration, [NotNull] string name) { var value = containerConfiguration.GetConfigurationOrNull(name); if (value == null) { throw new AbpException($"Could not find the configuration value for '{name}'!"); } return(value); }
public LoadBalancerConfiguration(LoadBalancerConfiguration fallbackConfiguration = null) { _fallbackConfiguration = fallbackConfiguration; _properties = new Dictionary <string, object>(); }
public static T GetConfiguration <T>( [NotNull] this LoadBalancerConfiguration containerConfiguration, [NotNull] string name) { return((T)containerConfiguration.GetConfiguration(name)); }