Class CreateBatchOptions
java.lang.Object
com.azure.messaging.eventhubs.models.CreateBatchOptions
The set of options that can be specified when creating an
EventDataBatch.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGets the maximum size to allow for the batch of events, in bytes.Gets the identifier of the Event Hub partition that the events in theEventDataBatchwill be sent to.Gets the partition routing key on an event batch.setMaximumSizeInBytes(int maximumSizeInBytes) Sets the maximum size for thebatch of events, in bytes.setPartitionId(String partitionId) Sets the identifier of the Event Hub partition that the events in theEventDataBatchwill be sent to.setPartitionKey(String partitionKey) Sets a hashing key to be provided for the batch of events.
-
Constructor Details
-
CreateBatchOptions
public CreateBatchOptions()Creates a new instance.
-
-
Method Details
-
setMaximumSizeInBytes
Sets the maximum size for thebatch of events, in bytes.- Parameters:
maximumSizeInBytes- The maximum size to allow for thebatch of events.- Returns:
- The updated
CreateBatchOptionsobject.
-
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
Sets a hashing key to be provided for the batch of events. Events with the samepartitionKeyare 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
CreateBatchOptionsobject.
-
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
Gets the identifier of the Event Hub partition that the events in theEventDataBatchwill 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
EventDataBatchwill be set to.nullor an empty string if Event Hubs service is responsible for routing events.
-
setPartitionId
Sets the identifier of the Event Hub partition that the events in theEventDataBatchwill 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 thebatch'sevents will be sent to.nullor an empty string if Event Hubs service is responsible for routing events.- Returns:
- The updated
CreateBatchOptionsobject.
-