EventProcessorOptions EventProcessorOptions Class

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.

Syntax

Declaration

public class EventProcessorOptionsPublic Class EventProcessorOptions

Inheritance Hierarchy

Constructors summary

Properties summary

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

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, String) or CreateReceiverAsync(String, DateTime) depending on the type of return value from delegate.

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.

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.

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.

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

Events summary

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

Constructors

  • EventProcessorOptions()
    EventProcessorOptions()
    public EventProcessorOptions()Public Sub New

Properties

  • DefaultOptions
    DefaultOptions

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

    public static EventProcessorOptions DefaultOptions { get; }Public Shared ReadOnly Property DefaultOptions As EventProcessorOptions

    Property Value

  • InitialOffsetProvider
    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, String) or CreateReceiverAsync(String, DateTime) depending on the type of return value from delegate.
    public Func<string, object> InitialOffsetProvider { get; set; }Public Property InitialOffsetProvider As Func(Of String, Object)

    Property Value

  • InvokeProcessorAfterReceiveTimeout
    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; }Public Property InvokeProcessorAfterReceiveTimeout As Boolean

    Property Value

    Remarks

    By default this option is turned off.

  • MaxBatchSize
    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; }Public Property MaxBatchSize As Integer

    Property Value

    Remarks

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

  • PrefetchCount
    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; }Public Property PrefetchCount As Integer

    Property Value

    Remarks

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

  • ReceiveTimeOut
    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; }Public Property ReceiveTimeOut As TimeSpan

    Property Value

    Remarks

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

Events

  • ExceptionReceived
    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> ExceptionReceivedPublic Event ExceptionReceived As EventHandler(Of ExceptionReceivedEventArgs)

Details

Namespace

Microsoft.ServiceBus.Messaging

Assembly

Microsoft.ServiceBus.dll