CreateBatchOptions Class
- java.
lang. Object - com.
azure. messaging. eventhubs. models. CreateBatchOptions
- com.
public class CreateBatchOptions
The set of options that can be specified when creating an EventDataBatch.
Constructor Summary
Constructor | Description |
---|---|
CreateBatchOptions() |
Creates a new instance. |
Method Summary
Modifier and Type | Method and Description |
---|---|
int |
getMaximumSizeInBytes()
Gets the maximum size to allow for the batch of events, in bytes. |
String |
getPartitionId()
Gets the identifier of the Event Hub partition that the events in the EventDataBatch will be sent to. |
String |
getPartitionKey()
Gets the partition routing key on an event batch. |
Create |
setMaximumSizeInBytes(int maximumSizeInBytes)
Sets the maximum size for the EventDataBatch, in bytes. |
Create |
setPartitionId(String partitionId)
Sets the identifier of the Event Hub partition that the events in the EventDataBatch will be sent to. |
Create |
setPartitionKey(String partitionKey)
Sets a hashing key to be provided for the batch of events. |
Methods inherited from java.lang.Object
Constructor Details
CreateBatchOptions
public CreateBatchOptions()
Creates a new instance.
Method Details
getMaximumSizeInBytes
public int getMaximumSizeInBytes()
Gets the maximum size to allow for the batch of events, in bytes.
Returns:
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:
null
or
an empty string if Event Hubs service is responsible for routing events.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:
setMaximumSizeInBytes
public CreateBatchOptions setMaximumSizeInBytes(int maximumSizeInBytes)
Sets the maximum size for the EventDataBatch, in bytes.
Parameters:
Returns:
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:
null
or an empty string if Event Hubs service is responsible for routing events.
Returns:
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:
Returns:
Applies to
Azure SDK for Java