Class CreateBatchOptions
java.lang.Object
com.azure.messaging.eventhubs.models.CreateBatchOptions
The set of options that can be specified when creating an
EventDataBatch
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Gets the maximum size to allow for the batch of events, in bytes.Gets the identifier of the Event Hub partition that the events in theEventDataBatch
will 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 theEventDataBatch
will be sent to.setPartitionKey
(String partitionKey) Sets a hashing key to be provided for the batch of events.
-
Constructor Details
-
CreateBatchOptions
public CreateBatchOptions()
-
-
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
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
Sets a hashing key to be provided for the batch of events. Events with the samepartitionKey
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
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 theEventDataBatch
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
Sets the identifier of the Event Hub partition that the events in theEventDataBatch
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 thebatch'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.
-