PluggableCheckpointStoreEventProcessor<TPartition> Class

Definition

Provides a base for creating an event processor with custom processing logic which consumes events across all partitions of a given Event Hub for a specific consumer group. The processor is capable of collaborating with other instances for the same Event Hub and consumer group pairing to share work by using a common storage platform to communicate. Fault tolerance is also built-in, allowing the processor to be resilient in the face of errors.

public abstract class PluggableCheckpointStoreEventProcessor<TPartition> : Azure.Messaging.EventHubs.Primitives.EventProcessor<TPartition> where TPartition : EventProcessorPartition, new()
type PluggableCheckpointStoreEventProcessor<'Partition (requires 'Partition :> EventProcessorPartition and 'Partition : (new : unit -> 'Partition))> = class
    inherit EventProcessor<'Partition (requires 'Partition :> EventProcessorPartition and 'Partition : (new : unit -> 'Partition))>
Public MustInherit Class PluggableCheckpointStoreEventProcessor(Of TPartition)
Inherits EventProcessor(Of TPartition)

Type Parameters

TPartition

The context of the partition for which an operation is being performed.

Inheritance
PluggableCheckpointStoreEventProcessor<TPartition>

Remarks

To enable coordination for sharing of partitions between PluggableCheckpointStoreEventProcessor<TPartition> instances, they will assert exclusive read access to partitions for the consumer group. No other readers should be active in the consumer group other than processors intending to collaborate. Non-exclusive readers will be denied access; exclusive readers, including processors using a different storage locations, will interfere with the processor's operation and performance.

The PluggableCheckpointStoreEventProcessor<TPartition> is safe to cache and use for the lifetime of an application, and that is best practice when the application processes events regularly or semi-regularly. The processor holds responsibility for efficient resource management, working to keep resource usage low during periods of inactivity and manage health during periods of higher use. Calling either the StopProcessingAsync(CancellationToken) or StopProcessing(CancellationToken) method when processing is complete or as the application is shutting down will ensure that network resources and other unmanaged objects are properly cleaned up.

Constructors

PluggableCheckpointStoreEventProcessor<TPartition>()

Initializes a new instance of the PluggableCheckpointStoreEventProcessor<TPartition> class.

PluggableCheckpointStoreEventProcessor<TPartition>(CheckpointStore, Int32, String, String, EventProcessorOptions)

Initializes a new instance of the PluggableCheckpointStoreEventProcessor<TPartition> class.

PluggableCheckpointStoreEventProcessor<TPartition>(CheckpointStore, Int32, String, String, String, AzureNamedKeyCredential, EventProcessorOptions)

Initializes a new instance of the PluggableCheckpointStoreEventProcessor<TPartition> class.

PluggableCheckpointStoreEventProcessor<TPartition>(CheckpointStore, Int32, String, String, String, AzureSasCredential, EventProcessorOptions)

Initializes a new instance of the PluggableCheckpointStoreEventProcessor<TPartition> class.

PluggableCheckpointStoreEventProcessor<TPartition>(CheckpointStore, Int32, String, String, String, EventProcessorOptions)

Initializes a new instance of the PluggableCheckpointStoreEventProcessor<TPartition> class.

PluggableCheckpointStoreEventProcessor<TPartition>(CheckpointStore, Int32, String, String, String, TokenCredential, EventProcessorOptions)

Initializes a new instance of the PluggableCheckpointStoreEventProcessor<TPartition> class.

Properties

ConsumerGroup

The name of the consumer group this event processor is associated with. Events will be read only in the context of this group.

(Inherited from EventProcessor<TPartition>)
EnableBatchTracing

Indicates whether or not this event processor should instrument batch event processing calls with distributed tracing. Implementations that instrument event processing themselves should set this to false.

(Inherited from EventProcessor<TPartition>)
EventHubName

The name of the Event Hub that the processor is connected to, specific to the Event Hubs namespace that contains it.

(Inherited from EventProcessor<TPartition>)
EventHubProperties

The properties associated with the Event Hub being read from. This value is updated in each load balancing cycle.

(Inherited from EventProcessor<TPartition>)
FullyQualifiedNamespace

The fully qualified Event Hubs namespace that the processor is associated with. This is likely to be similar to {yournamespace}.servicebus.windows.net.

(Inherited from EventProcessor<TPartition>)
Identifier

A unique name used to identify this event processor.

(Inherited from EventProcessor<TPartition>)
IsRunning

Indicates whether or not this event processor is currently running.

(Inherited from EventProcessor<TPartition>)
RetryPolicy

The active policy which governs retry attempts for the processor.

(Inherited from EventProcessor<TPartition>)

Methods

ClaimOwnershipAsync(IEnumerable<EventProcessorPartitionOwnership>, CancellationToken)

Attempts to claim ownership of the specified partitions for processing. This operation is used by load balancing to enable distributing the responsibility for processing partitions for an Event Hub and consumer group pairing amongst the active event processors.

CreateConnection()

Creates an EventHubConnection to use for communicating with the Event Hubs service.

(Inherited from EventProcessor<TPartition>)
GetCheckpointAsync(String, CancellationToken)

Returns a checkpoint for the Event Hub, consumer group, and identifier of the partition associated with the event processor instance, so that processing for a given partition can be properly initialized.

ListOwnershipAsync(CancellationToken)

Requests a list of the ownership assignments for partitions between each of the cooperating event processor instances for a given Event Hub and consumer group pairing. This method is used during load balancing to allow the processor to discover other active collaborators and to make decisions about how to best balance work between them.

ListPartitionIdsAsync(EventHubConnection, CancellationToken)

Queries for the identifiers of the Event Hub partitions.

(Inherited from EventProcessor<TPartition>)
OnInitializingPartitionAsync(TPartition, CancellationToken)

Performs the tasks to initialize a partition, and its associated context, for event processing.

(Inherited from EventProcessor<TPartition>)
OnPartitionProcessingStoppedAsync(TPartition, ProcessingStoppedReason, CancellationToken)

Performs the tasks needed when processing for a partition is being stopped. This commonly occurs when the partition is claimed by another event processor instance or when the current event processor instance is shutting down.

(Inherited from EventProcessor<TPartition>)
OnProcessingErrorAsync(Exception, TPartition, String, CancellationToken)

Performs the tasks needed when an unexpected exception occurs within the operation of the event processor infrastructure.

(Inherited from EventProcessor<TPartition>)
OnProcessingEventBatchAsync(IEnumerable<EventData>, TPartition, CancellationToken)

Performs the tasks needed to process a batch of events for a given partition as they are read from the Event Hubs service.

(Inherited from EventProcessor<TPartition>)
ReadLastEnqueuedEventProperties(String)

A set of information about the last enqueued event of a partition, as observed by the associated EventHubs client associated with this context as events are received from the Event Hubs service. This is only available if the consumer was created with TrackLastEnqueuedEventProperties set.

(Inherited from EventProcessor<TPartition>)
StartProcessing(CancellationToken)

Signals the EventProcessor<TPartition> to begin processing events. Should this method be called while the processor is running, no action is taken.

(Inherited from EventProcessor<TPartition>)
StartProcessingAsync(CancellationToken)

Signals the EventProcessor<TPartition> to begin processing events. Should this method be called while the processor is running, no action is taken.

(Inherited from EventProcessor<TPartition>)
StopProcessing(CancellationToken)

Signals the EventProcessor<TPartition> to stop processing events. Should this method be called while the processor is not running, no action is taken.

(Inherited from EventProcessor<TPartition>)
StopProcessingAsync(CancellationToken)

Signals the EventProcessor<TPartition> to stop processing events. Should this method be called while the processor is not running, no action is taken.

(Inherited from EventProcessor<TPartition>)
UpdateCheckpointAsync(String, CheckpointPosition, CancellationToken)

Creates or updates a checkpoint for a specific partition, identifying a position in the partition's event stream that an event processor should begin reading from.

UpdateCheckpointAsync(String, Int64, Nullable<Int64>, CancellationToken)

Creates or updates a checkpoint for a specific partition, identifying a position in the partition's event stream that an event processor should begin reading from.

UpdateCheckpointAsync(String, Int64, Nullable<Int64>, CancellationToken)

Creates or updates a checkpoint for a specific partition, identifying a position in the partition's event stream that an event processor should begin reading from.

(Inherited from EventProcessor<TPartition>)
ValidateProcessingPreconditions(CancellationToken)

Performs the tasks needed to validate basic configuration and permissions of the dependencies needed for the processor to function.

(Inherited from EventProcessor<TPartition>)

Applies to