public class SendOptions extends Object
Constructor and Description |
---|
SendOptions() |
Modifier and Type | Method and Description |
---|---|
String |
getPartitionId()
Gets the identifier of the Event Hub partition that the
events will be sent to. |
String |
getPartitionKey()
Gets the hashing key on an event batch.
|
SendOptions |
setPartitionId(String partitionId)
Sets the identifier of the Event Hub partition that the
events will be sent to. |
SendOptions |
setPartitionKey(String partitionKey)
Sets a hashing key to be provided for the batch of events, which instructs the Event Hubs service to map this key
to a specific partition.
|
public SendOptions setPartitionKey(String partitionKey)
The selection of a partition is stable for a given partition hashing key. Should any other batches of events be sent using the same exact partition hashing key, the Event Hubs service will route them all to the same partition.
This should be specified only when there is a need to group events by partition, but there is flexibility into
which partition they are routed. If ensuring that a batch of events is sent only to a specific partition, it is
recommended that the identifier of the position be specified directly
when
sending the batch.
partitionKey
- The partition hashing key to associate with the event or batch of events.SendOptions
object.public String getPartitionKey()
public String getPartitionId()
events
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.events
will be set to. null
or an empty string if Event Hubs service is responsible for routing events.public SendOptions setPartitionId(String partitionId)
events
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.partitionId
- The identifier of the Event Hub partition that the events
will be set
to. null
or an empty string if Event Hubs service is responsible for routing events.SendOptions
object.Copyright © 2019 Microsoft Corporation. All rights reserved.