Class PartitionReceiverOptions
The set of options that can be specified when creating a PartitionReceiver to configure its behavior.
Inheritance
Namespace: System.Dynamic.ExpandoObject
Assembly: Azure.Messaging.EventHubs.dll
Syntax
public class PartitionReceiverOptions
Constructors
PartitionReceiverOptions()
Declaration
public PartitionReceiverOptions ();
Properties
ConnectionOptions
The options used for configuring the connection to the Event Hubs service.
Declaration
public Azure.Messaging.EventHubs.EventHubConnectionOptions ConnectionOptions { get; set; }
Property Value
EventHubConnectionOptions
|
DefaultMaximumReceiveWaitTime
The default amount of time to wait for the requested amount of messages when reading; if this period elapses before the requested amount of messages were available or read, then the set of messages that were read will be returned.
Declaration
public Nullable<TimeSpan> DefaultMaximumReceiveWaitTime { get; set; }
Property Value
System.Nullable<System.TimeSpan>
The default wait time is 60 seconds. |
Exceptions
System.ArgumentOutOfRangeException
Occurs when the requested wait time is negative. |
Identifier
A unique name used to identify the receiver. If null
or empty, a GUID will be used as the
identifier.
Declaration
public string Identifier { get; set; }
Property Value
System.String
If not specified, a random unique identifier will be generated. |
OwnerLevel
When populated, the owner level indicates that a reading is intended to be performed exclusively for events in the requested partition and for the associated consumer group. To do so, reading will attempt to assert ownership over the partition; in the case where more than one exclusive reader attempts to assert ownership for the same partition/consumer group pair, the one having a larger OwnerLevel value will "win."
When an exclusive reader is used, other readers which are non-exclusive or which have a lower owner level will either not be allowed to be created, if they already exist, will encounter an exception during the next attempted operation.
Declaration
public Nullable<long> OwnerLevel { get; set; }
Property Value
System.Nullable<System.Int64>
The relative priority to associate with an exclusive reader; for a non-exclusive reader, this value should be |
Exceptions
EventHubsException
Occurs when the owner level is set and the PartitionReceiver is unable to read from the requested Event Hub partition due to being denied ownership. In this case, the EventHubsException.FailureReason will be set to ConsumerDisconnected. |
See Also
PrefetchCount
The number of events that will be eagerly requested from the Event Hubs service and queued locally without regard to whether a read operation is currently active, intended to help maximize throughput by allowing events to be read from from a local cache rather than waiting on a service request.
Declaration
public int PrefetchCount { get; set; }
Property Value
System.Int32
The PrefetchCount is a control that developers can use to help tune performance for the specific needs of an application, given its expected size of events, throughput needs, and expected scenarios for using Event Hubs. The default prefetch count is 300. |
Exceptions
System.ArgumentOutOfRangeException
Occurs when the requested count is negative. |
PrefetchSizeInBytes
The desired number of bytes to attempt to eagerly request from the Event Hubs service and queued locally without regard to whether a read operation is currently active, intended to help maximize throughput by allowing events to be read from from a local cache rather than waiting on a service request.
Declaration
public Nullable<long> PrefetchSizeInBytes { get; set; }
Property Value
System.Nullable<System.Int64>
When set to This size should be considered a statement of intent rather than a guaranteed limit; the local cache may be larger or smaller than the number of bytes specified, and will always contain at least one event when the PrefetchSizeInBytes is specified. A heuristic is used to predict the average event size to use for size calculations, which should be expected to fluctuate as traffic passes through the system. Consequently, the resulting resource use will fluctuate as well. This option is disabled by default with the value set to |
Exceptions
System.ArgumentOutOfRangeException
Occurs when the requested size is negative. |
RetryOptions
The set of options to use for determining whether a failed operation should be retried and, if so, the amount of time to wait between retry attempts. These options also control the amount of time allowed for reading events and other interactions with the Event Hubs service.
Declaration
public Azure.Messaging.EventHubs.EventHubsRetryOptions RetryOptions { get; set; }
Property Value
EventHubsRetryOptions
|
TrackLastEnqueuedEventProperties
Indicates whether or not the reader should request information on the last enqueued event on the partition associated with a given event, and track that information as events are read.
Declaration
public bool TrackLastEnqueuedEventProperties { get; set; }
Property Value
System.Boolean
|
Remarks
When information about a 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 one of the Event Hub clients.
Methods
Equals(Object)
Determines whether the specified System.Object is equal to this instance.
Declaration
[System.ComponentModel.EditorBrowsable]
public override bool Equals (object obj);
Parameters
System.Object
obj
The System.Object to compare with this instance. |
Returns
System.Boolean
|
GetHashCode()
Returns a hash code for this instance.
Declaration
[System.ComponentModel.EditorBrowsable]
public override int GetHashCode ();
Returns
System.Int32
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
ToString()
Converts the instance to string representation.
Declaration
[System.ComponentModel.EditorBrowsable]
public override string ToString ();
Returns
System.String
A System.String that represents this instance. |