/// <summary> /// Configures the stream provider to use the lease based queue balancer. /// </summary> /// <param name="configurator">The configuration builder.</param> /// <param name="configureOptions">The configure options.</param> public static void UseLeaseBasedQueueBalancer(this ISiloPersistentStreamConfigurator configurator, Action <OptionsBuilder <LeaseBasedQueueBalancerOptions> > configureOptions = null) { configurator.ConfigurePartitionBalancing((s, n) => LeaseBasedQueueBalancer.Create(s, n), configureOptions); }
public static void UseClusterConfigDeploymentLeaseBasedBalancer(this ISiloPersistentStreamConfigurator configurator, Action <OptionsBuilder <LeaseBasedQueueBalancerOptions> > configureOptions = null) { configurator.ConfigurePartitionBalancing((s, n) => LeaseBasedQueueBalancer.Create(s, n, s.GetRequiredService <IOptions <StaticClusterDeploymentOptions> >().Value), configureOptions); }
/// <summary> /// Stream queue balancer that uses Azure deployment information for load balancing. /// Requires silo running in Azure. /// This balancer supports queue balancing in cluster auto-scale scenario, unexpected server failure scenario, and try to support ideal distribution /// </summary> public static void UseAzureDeploymentLeaseBasedBalancer(this ISiloPersistentStreamConfigurator configurator, Action <OptionsBuilder <LeaseBasedQueueBalancerOptions> > configureOptions = null) { configurator.ConfigurePartitionBalancing( (s, n) => LeaseBasedQueueBalancer.Create(s, n, new ServiceRuntimeWrapper(s.GetService <ILoggerFactory>())), configureOptions); }