EventProcessorClient.ProcessEventAsync Event

Definition

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

Should an exception occur within the code for this method, the event processor will allow it to propagate up the stack without attempting to handle it in any way. On most hosts, this will fault the task responsible for partition processing, causing it to be restarted from the last checkpoint. On some hosts, it may crash the process. Developers are strongly encouraged to take all exception scenarios into account and guard against them using try/catch blocks and other means as appropriate.

It is not recommended that the state of the processor be managed directly from within this handler; requesting to start or stop the processor may result in a deadlock scenario, especially if using the synchronous form of the call.

public event Func<Azure.Messaging.EventHubs.Processor.ProcessEventArgs,System.Threading.Tasks.Task> ProcessEventAsync;
member this.ProcessEventAsync : Func<Azure.Messaging.EventHubs.Processor.ProcessEventArgs, System.Threading.Tasks.Task> 
Public Custom Event ProcessEventAsync As Func(Of ProcessEventArgs, Task) 

Event Type

Exceptions

If an attempt is made to remove a handler that doesn't match the current handler registered.

If an attempt is made to add a handler when one is currently registered.

Remarks

This handler will be invoked concurrently, limited to one call per partition. The processor will await each invocation to ensure that the events from the same partition are processed one-at-a-time in the order that they were read from the partition.

No time limit is imposed on an invocation of this handler; the processor will wait indefinitely for execution to complete before dispatching another event for the associated partition. It is safe for implementations to perform long-running operations, retries, delays, and dead-lettering activities.

Applies to

See also