Dela via


SendEventOptions.PartitionId Property

Definition

If specified, events be published to this specific partition. If the identifier is not specified, Event Hubs will be responsible for assigning events automatically to an available partition.

public string PartitionId { get; set; }
member this.PartitionId : string with get, set
Public Property PartitionId As String

Property Value

The identifier of the desired partition to assign for the events, if null, the events will be automatically assigned to a partition.

The default partition identifier value is null.

Remarks

If the PartitionId is specified, then no PartitionKey may be set when sending.

Allowing automatic routing of partitions is recommended when:

  • The sending of events needs to be highly available.
  • The event data should be evenly distributed among all available partitions.

If no partition is specified, the following rules are used for automatically selecting one:

  1. Distribute the events equally amongst all available partitions using a round-robin approach.
  2. If a partition becomes unavailable, the Event Hubs service will automatically detect it and forward the message to another available partition.

Applies to