SALES: 1-800-867-1380

EventProcessorHost Class

Represents a host for processing Event Hubs event data.

System.Object
  Microsoft.ServiceBus.Messaging.EventProcessorHost

Namespace:  Microsoft.ServiceBus.Messaging
Assembly:  Microsoft.ServiceBus.Messaging.EventProcessorHost (in Microsoft.ServiceBus.Messaging.EventProcessorHost.dll)

public class EventProcessorHost

The EventProcessorHost type exposes the following members.

  NameDescription
Public methodEventProcessorHost(String, String, String, String, String)Initializes a new instance of the EventProcessorHost class.
Public methodEventProcessorHost(String, String, String, String, String, String)Initializes a new instance of the EventProcessorHost class.
Top

  NameDescription
Public propertyHostNameGets the host name, which is a unique name for the EventProcessorHost instance.
Public propertyPartitionManagerOptionsGets or sets the Microsoft.ServiceBus.Messaging.PartitionManagerOptions instance used by the EventProcessorHost object.
Top

  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodRegisterEventProcessorAsync<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.
Public methodRegisterEventProcessorAsync<T>(EventProcessorOptions)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.
Public methodRegisterEventProcessorFactoryAsync(IEventProcessorFactory)Asynchronously registers the event processor factory.
Public methodRegisterEventProcessorFactoryAsync(IEventProcessorFactory, EventProcessorOptions)Asynchronously registers the event processor factory.
Public methodToString (Inherited from Object.)
Public methodUnregisterEventProcessorAsyncAsynchronously 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 method with a CloseReason.Shutdown object.
Top

EventProcessorHost distributes Event Hubs partitions among EventProcessorHost instances. It creates an Azure Block Blob for each partition in the Event Hub, and uses these blobs for managing leases for a partition.

Each EventProcessorHost instance performs the following two tasks:

  1. Renew Leases: Tracks leases currently owned by the host and continuously renews the leases.

  2. Acquire Leases: Each instance continuously polls all the lease blobs to check whether there are any leases it must acquire in order for the system to achieve a balanced state.

Client applications must implement IEventProcessor and register the processor implementation with EventProcessorHost.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft