com.microsoft.azure.eventprocessorhost

Classes

AzureStoragePartitionManagerOptions
BaseLease

BaseLease class is public so that advanced users can implement an ILeaseManager. Unless you are implementing ILeaseManager you should not have to deal with objects of this class or derived classes directly.

This lightweight base exists to allow ILeaseManager.getAllLeases to operate as quickly as possible for some lease manager implementations, loading the entire contents of a lease form the store may be expensive. BaseLease contains only the minimum amount of information required to allow PartitionScanner to operate.

Note that a Lease object just carries information about a partition lease. The APIs to acquire/renew/release a lease are all on ILeaseManager.

Checkpoint

Checkpoint class is public so that advanced users can implement an ICheckpointManager. Unless you are implementing ICheckpointManager you should not have to deal with objects of this class directly.

A Checkpoint is essentially just a tuple. It has a fixed partition id, set at creation time and immutable thereafter, and associates that with an offset/sequenceNumber pair which indicates a position within the events in that partition.

CompleteLease

CompleteLease class is public so that advanced users can implement an ILeaseManager. Unless you are implementing ILeaseManager you should not have to deal with objects of this class or derived classes directly.

CompleteLease carries around complete information about a lease. By itself, it has the epoch. Any lease manager implementation can derive from this class to add data which the lease manager needs to function see AzureBlobLease for an example. Having two distinct classes allows the code to clearly express which variety of lease any variable holds or a method requires, and avoids the problem of accidentally supplying a lightweight BaseLease to a method which needs the lease-manager-specific fields.

EventProcessorHost
EventProcessorHostActionStrings
EventProcessorOptions
ExceptionReceivedEventArgs

Passed as an argument to the general exception handler that can be set via EventProcessorOptions.

InMemoryCheckpointManager
InMemoryLeaseManager
LeaseLostException
LoggingUtils

Centralize log message generation

PartitionContext
PartitionManagerOptions
EventProcessorOptions.EndOfStreamInitialPositionProvider
EventProcessorOptions.StartOfStreamInitialPositionProvider

Interfaces

ICheckpointManager
IEventProcessor

Interface that must be implemented by event processor classes.

Any given instance of an event processor class will only process events from one partition of one Event Hub. A PartitionContext is provided with each call to the event processor because some parameters could change, but it will always be the same partition.

Although EventProcessorHost is multithreaded, calls to a given instance of an event processor class are serialized, except for onError(). onOpen() is called first, then onEvents() will be called zero or more times. When the event processor needs to be shut down, whether because there was a failure somewhere, or the lease for the partition has been lost, or because the entire processor host is being shut down, onClose() is called after the last onEvents() call returns.

onError() could be called while onEvents() or onClose() is executing. No synchronization is attempted in order to avoid possibly deadlocking.

IEventProcessorFactory<T>

Interface that must be implemented by an event processor factory class.

User-provided factories are needed if creating an event processor object requires more work than just a new with a parameterless constructor.

ILeaseManager

Enums

CloseReason