EventProcessorClient Class

Definition

Allows for consuming and processing events across all partitions of a given Event Hub within the scope of 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 class EventProcessorClient : Azure.Messaging.EventHubs.Primitives.EventProcessor<Azure.Messaging.EventHubs.Primitives.EventProcessorPartition>
type EventProcessorClient = class
    inherit EventProcessor<EventProcessorPartition>
Public Class EventProcessorClient
Inherits EventProcessor(Of EventProcessorPartition)
Inheritance

Constructors

EventProcessorClient()

Initializes a new instance of the EventProcessorClient class.

EventProcessorClient(BlobContainerClient, String, String)

Initializes a new instance of the EventProcessorClient class.

EventProcessorClient(BlobContainerClient, String, String, EventProcessorClientOptions)

Initializes a new instance of the EventProcessorClient class.

EventProcessorClient(BlobContainerClient, String, String, String)

Initializes a new instance of the EventProcessorClient class.

EventProcessorClient(BlobContainerClient, String, String, String, EventProcessorClientOptions)

Initializes a new instance of the EventProcessorClient class.

EventProcessorClient(BlobContainerClient, String, String, String, TokenCredential, EventProcessorClientOptions)

Initializes a new instance of the EventProcessorClient 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.

EventHubName

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

FullyQualifiedNamespace

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

Identifier

A unique name used to identify this event processor.

IsRunning

Indicates whether or not this event processor is currently running.

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 method is used by load balancing to allow event processor instances to distribute the responsibility for processing partitions for a given Event Hub and consumer group pairing amongst the active event processors.

CreateConnection()

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

ListCheckpointsAsync(CancellationToken)

Produces a list of the available checkpoints for the Event Hub and consumer group associated with the event processor instance, so that processing for a given set of partitions can be properly initialized.

ListOwnershipAsync(CancellationToken)

Produces 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 when load balancing to allow the processor to discover other active collaborators and to make decisions about how to best balance work between them.

OnInitializingPartitionAsync(EventProcessorPartition, CancellationToken)

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

OnInitializingPartitionAsync(TPartition, CancellationToken)

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

(Inherited from EventProcessor<TPartition>)
OnPartitionProcessingStoppedAsync(EventProcessorPartition, 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.

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, EventProcessorPartition, String, CancellationToken)

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

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>, EventProcessorPartition, CancellationToken)

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

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 EventProcessorClient to begin processing events. Should this method be called while the processor is running, no action is taken.

StartProcessingAsync(CancellationToken)

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

StopProcessing(CancellationToken)

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

StopProcessingAsync(CancellationToken)

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

Events

PartitionClosingAsync

The event to be raised once event processing stops for a given partition.

PartitionInitializingAsync

The event to be raised just before event processing starts for a given partition.

ProcessErrorAsync

The event responsible for processing unhandled exceptions thrown while this processor is running. Implementation is mandatory.

ProcessEventAsync

The event responsible for processing events received from the Event Hubs service. Implementation is mandatory.

Applies to