Megosztás a következőn keresztül:


EventProcessorHost Class

Definition

A very simple host for processing EventHub messages. It takes care of distributing EventHub partitions among EventProcessorHost instances. It creates an Azure Block Blob for each partition in EventHub and use these blobs for managing lease for a partition. Every EventProcessorHost instance is performing the following two tasks: 1) Renew Leases: It keeps track of leases currently owned by the host and continuously keeps on renewing the leases. 2) Acquire Leases: Each instance continuously polls all the lease blobs to check if there are any leases it should acquire for the system to get into balanced state. Client application needs to implement IEventProcessor and register processor implementation with EventProcessorHost.

public class EventProcessorHost : IDisposable
type EventProcessorHost = class
    interface IDisposable
Public Class EventProcessorHost
Implements IDisposable
Inheritance
EventProcessorHost
Implements

Constructors

EventProcessorHost(String, String, String, Func<EventProcessorOptions,MessagingFactory>, Func<CloudBlobClient>, String, String)

Creates new instance of EventProcessorHost.

EventProcessorHost(String, String, String, Func<EventProcessorOptions,MessagingFactory>, Func<CloudBlobClient>)

Creates new instance of EventProcessorHost.

EventProcessorHost(String, String, String, String, String, String, String)

Initializes a new instance of the EventProcessorHost class.

EventProcessorHost(String, String, String, String, String)

Initializes a new instance of the EventProcessorHost class.

EventProcessorHost(String, String, String, String)

Creates new instance of EventProcessorHost.

Properties

HostName

Gets the host name, which is a unique name for the EventProcessorHost instance.

PartitionManagerOptions

Gets or sets the PartitionManagerOptions instance used by the EventProcessorHost object.

Methods

Dispose()
Dispose(Boolean)
RegisterEventProcessorAsync<T>()

Asynchronously registers the IEventProcessor interface implementation with the host using the DefaultEventProcessorFactory<T> factory. This method also starts the host and enables it to start participating in the partition distribution process.

RegisterEventProcessorAsync<T>(EventProcessorOptions)

This registers IEventProcessor implementation with the host using DefaultEventProcessorFactory<T>.
This also starts the host and causes it to start participating in the partition distribution process.

RegisterEventProcessorFactoryAsync(IEventProcessorFactory, EventProcessorOptions)

This registers IEventProcessorFactory implementation with the host which is used to create an instance of IEventProcessor when it takes ownership of a partition. This also starts the host and causes it to start participating in the partition distribution process.

RegisterEventProcessorFactoryAsync(IEventProcessorFactory)

This registers IEventProcessorFactory implementation with the host which is used to create an instance of IEventProcessor when it takes ownership of a partition. This also starts the host and causes it to start participating in the partition distribution process.

ResetAllConnections()

Reset all Event Hubs receiver connections used by this instance of EventProcessorHost.

ResetConnection(String)
UnregisterEventProcessorAsync()

Asynchronously shuts down the EventProcessorHost instance. This method maintains the leases on all partitions currently held, and enables each IEventProcessor instance to shut down cleanly by invoking the CloseAsync(PartitionContext, CloseReason) method with a Shutdown object after current execution of ProcessEventsAsync(PartitionContext, IEnumerable<EventData>) completes.

Applies to