Enum LoadBalancingStrategy

java.lang.Object
java.lang.Enum<LoadBalancingStrategy>
com.azure.messaging.eventhubs.LoadBalancingStrategy
All Implemented Interfaces:
Serializable, Comparable<LoadBalancingStrategy>, java.lang.constant.Constable

public enum LoadBalancingStrategy extends Enum<LoadBalancingStrategy>
The strategy used by event processor for load balancing the partition ownership to distribute the event processing work with other processor instances.
See Also:
  • Enum Constant Details

    • BALANCED

      public static final LoadBalancingStrategy BALANCED
      The event processor will use a steady approach to claim ownership of partitions and slowly trend towards a stable state where all active processors will have an even distribution of Event Hub partitions. This strategy may take longer to settle into a balanced partition distribution among active processor instances. This strategy is geared towards minimizing ownership contention and reducing the need to transfer ownership frequently, especially when multiple instances are initialized together, until a stable state is reached.
    • GREEDY

      public static final LoadBalancingStrategy GREEDY
      The event processor will attempt to claim its fair share of partition ownership greedily. This enables event processing of all partitions to start/resume quickly when there is an imbalance detected by the processor. This may result in ownership of partitions frequently changing when multiple instances are starting up but will eventually converge to a stable state.
  • Method Details

    • values

      public static LoadBalancingStrategy[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static LoadBalancingStrategy valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null