EventProcessorOptions Class

Definition

Defines the runtime options when registering an IEventProcessor interface with an EventHubConsumerGroup. This is also the mechanism for catching exceptions from an IEventProcessor instance used by an EventProcessorHost object.

public sealed class EventProcessorOptions
type EventProcessorOptions = class
Public NotInheritable Class EventProcessorOptions
Inheritance
EventProcessorOptions

Constructors

EventProcessorOptions()

Creates a new EventProcessorOptions object.

Properties

DefaultOptions

Returns an EventProcessorOptions instance with all options set to the default values. The default values are:

MaxBatchSize: 10

ReceiveTimeOut: 1 minute

PrefetchCount: 300

InitialOffsetProvider: uses the last offset checkpointed, or StartOfStream

InvokeProcessorAfterReceiveTimeout: false

EnableReceiverRuntimeMetric

Gets or sets a value indicating whether the runtime metric of a receiver is enabled.

InitialOffsetProvider

Gets or sets a delegate which is used to get the initial position for a given partition to create PartitionReceiver. Delegate is invoked by passing in PartitionId and then user can return PartitionReceiver for receiving messages. This is only used when a checkpoint cannot be found for the associated partition.

InvokeProcessorAfterReceiveTimeout

Returns whether the EventProcessorHost will call IEventProcessor.OnEvents(null) when a receive timeout occurs (true) or not (false).

MaxBatchSize

Returns the maximum size of an event batch that IEventProcessor.ProcessEventsAsync will be called with

PrefetchCount

Gets or sets the current prefetch count for the underlying client. The default is 300.

ReceiveTimeout

Gets or sets the timeout length for receive operations.

WebProxy

Gets or sets the web proxy. A proxy is applicable only when transport type is set to AmqpWebSockets.

Methods

SetExceptionHandler(Action<ExceptionReceivedEventArgs>)

Sets a handler which receives notification of general exceptions.

Exceptions which occur while processing events from a particular Event Hub partition are delivered to the onError method of the event processor for that partition. This handler is called on occasions when there is no event processor associated with the throwing activity, or the event processor could not be created.

Applies to