Table of Contents

Class EventProcessorOptions

Namespace
Microsoft.ServiceBus.Messaging
Assembly
Microsoft.ServiceBus.dll

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 class EventProcessorOptions
Inheritance
EventProcessorOptions
Inherited Members

Constructors

EventProcessorOptions()

public EventProcessorOptions()

Properties

DefaultOptions

Gets the default options, which is 10 for the MaxBatchSize, and 1 minute for the ReceiveTimeOut property.

public static EventProcessorOptions DefaultOptions { get; }

Property Value

EventProcessorOptions

Returns EventProcessorOptions.

EnableReceiverRuntimeMetric

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

public bool EnableReceiverRuntimeMetric { get; set; }

Property Value

bool

true if a client wants to access ReceiverRuntimeInfo using PartitionContext.

InitialOffsetProvider

Gets or sets a delegate which is used to get the initial offset for a given partition to create EventHubReceiver. Delegate is invoked by passing in PartitionId and then user can return either the starting offset as string or starting UTC time for receiving messages. This is only used when Offset is not provided and receiver is being created for the very first time. This corresponds to either CreateReceiverAsync(string, ReceiverOptions) or CreateReceiverAsync(string, DateTime, ReceiverOptions) depending on the type of return value from delegate.

public Func<string, object> InitialOffsetProvider { get; set; }

Property Value

Func<string, object>

InvokeProcessorAfterReceiveTimeout

Enabling this option will cause ProcessEventsAsync(PartitionContext, IEnumerable<EventData>) to be invoked after every ReceiveTimeout when there are no more messages in the stream for a partition.

public bool InvokeProcessorAfterReceiveTimeout { get; set; }

Property Value

bool

Remarks

By default this option is turned off.

MaxBatchSize

Gets or sets the maximum event count that a user is willing to accept for processing per receive loop. This count is on a per-Event Hub partition level.

public int MaxBatchSize { get; set; }

Property Value

int

Returns int.

Remarks

This corresponds to the maxCount argument in Receive(int, TimeSpan)

PrefetchCount

Gets or sets the number of events that any receiver in the currently owned partition will actively cache. The default value for this property is 300.

public int PrefetchCount { get; set; }

Property Value

int

Returns int.

Remarks

This property is use to set PrefetchCount property on the underlying MessagingFactory created by host

ReceiveTimeOut

Gets or sets the timespan in which the user is willing to wait when the event processor is performing a receive operation.

public TimeSpan ReceiveTimeOut { get; set; }

Property Value

TimeSpan

Returns TimeSpan.

Remarks

This correspond to the waitTime argument in Receive(int, TimeSpan)

Events

ExceptionReceived

This event fires whenever an exception is encountered when processing events. User can register an handler to this event for getting exception notification.

public event EventHandler<ExceptionReceivedEventArgs> ExceptionReceived

Event Type

EventHandler<ExceptionReceivedEventArgs>