Class CreateBatchOptions

java.lang.Object
com.azure.messaging.eventhubs.models.CreateBatchOptions

public class CreateBatchOptions extends Object
The set of options that can be specified when creating an EventDataBatch.
See Also:
  • Constructor Details

    • CreateBatchOptions

      public CreateBatchOptions()
  • Method Details

    • setMaximumSizeInBytes

      public CreateBatchOptions setMaximumSizeInBytes(int maximumSizeInBytes)
      Sets the maximum size for the batch of events, in bytes.
      Parameters:
      maximumSizeInBytes - The maximum size to allow for the batch of events.
      Returns:
      The updated CreateBatchOptions object.
    • getMaximumSizeInBytes

      public int getMaximumSizeInBytes()
      Gets the maximum size to allow for the batch of events, in bytes.
      Returns:
      The maximum size to allow for a single batch of events, in bytes.
    • setPartitionKey

      public CreateBatchOptions setPartitionKey(String partitionKey)
      Sets a hashing key to be provided for the batch of events. Events with the same partitionKey are hashed and sent to the same partition.
      Parameters:
      partitionKey - The partition hashing key to associate with the event or batch of events.
      Returns:
      The updated CreateBatchOptions object.
    • getPartitionKey

      public String getPartitionKey()
      Gets the partition routing key on an event batch. If specified, tells the Event Hubs service that these events belong to the same group and should belong to the same partition.
      Returns:
      The partition hashing key to associate with the event or batch of events.
    • getPartitionId

      public String getPartitionId()
      Gets the identifier of the Event Hub partition that the events in the EventDataBatch will be sent to. If the identifier is not specified, the Event Hubs service will be responsible for routing events that are sent to an available partition.
      Returns:
      The identifier of the Event Hub partition that the EventDataBatch will be set to. null or an empty string if Event Hubs service is responsible for routing events.
    • setPartitionId

      public CreateBatchOptions setPartitionId(String partitionId)
      Sets the identifier of the Event Hub partition that the events in the EventDataBatch will be sent to. If the identifier is not specified, the Event Hubs service will be responsible for routing events that are sent to an available partition.
      Parameters:
      partitionId - The identifier of the Event Hub partition that the batch's events will be sent to. null or an empty string if Event Hubs service is responsible for routing events.
      Returns:
      The updated CreateBatchOptions object.