public class ReceiveOptions extends Object
EventHubConsumerAsyncClient
or
EventHubConsumerClient
.Constructor and Description |
---|
ReceiveOptions() |
Modifier and Type | Method and Description |
---|---|
Long |
getOwnerLevel()
Gets the owner level for this consumer.
|
boolean |
getTrackLastEnqueuedEventProperties()
Gets whether or not the receive operation should request information on the last enqueued event on its associated
partition, and track that information as events are received.
|
ReceiveOptions |
setOwnerLevel(Long priority)
Sets the
ownerLevel value on this receive operation. |
ReceiveOptions |
setTrackLastEnqueuedEventProperties(boolean trackLastEnqueuedEventProperties)
Sets whether or not the receive operation should request information on the last enqueued event on its associated
partition, and track that information as events are received.
|
public Long getOwnerLevel()
null
, then this is not an exclusive consumer.
Otherwise, it is an exclusive consumer, and there can only be one active consumer for each partition and consumer
group combination. The exclusive consumer is be based on which one has the higher owner level value.null
, then this is not an exclusive consumer.public ReceiveOptions setOwnerLevel(Long priority)
ownerLevel
value on this receive operation. When populated, the level indicates that the receive
operation is intended to be the only reader of events for the requested partition and associated consumer group.
To do so, this receive operation will attempt to assert ownership over the partition; in the case where
there is more than one exclusive receive operation for the same partition/consumer group pair, the one having a
larger ReceiveOptions.getOwnerLevel()
value will "win".
When an exclusive receive operation is used, those receive operations which are not exclusive or which have a lower priority will either not be allowed to be created. If they already exist, will encounter an exception during the next attempted operation.
priority
- The priority associated with an exclusive receive operation; for a non-exclusive receive
operation, this value should be null
.ReceiveOptions
object.IllegalArgumentException
- if priority
is not null
and is less than 0.public boolean getTrackLastEnqueuedEventProperties()
true
if the resulting receive operation will keep track of the last enqueued information for that
partition; false
otherwise.public ReceiveOptions setTrackLastEnqueuedEventProperties(boolean trackLastEnqueuedEventProperties)
When information about the partition's last enqueued event is being tracked, each event received from the Event Hubs service will carry metadata about the partition that it otherwise would not. This results in a small amount of additional network bandwidth consumption that is generally a favorable trade-off when considered against periodically making requests for partition properties using the Event Hub client.
trackLastEnqueuedEventProperties
- true
if the resulting events will keep track of the last
enqueued information for that partition; false
otherwise.ReceiveOptions
object.Copyright © 2019 Microsoft Corporation. All rights reserved.