Skip to content

EventHubCheckpointer Methods

This class stores EventHub partition checkpoint information in Azure Table Storage.

Create(AzureTableStreamCheckpointerOptions, string, string, string, ILoggerFactory)

static
View source
public static Task<IStreamQueueCheckpointer<string>> Create(AzureTableStreamCheckpointerOptions options, string streamProviderName, string partition, string serviceId, ILoggerFactory loggerFactory)
Creates and initializes an Event Hub partition checkpointer.

Parameters

optionsAzureTableStreamCheckpointerOptions
The Azure Table Storage checkpointer options.
streamProviderNamestring
The stream provider name.
partitionstring
The Event Hub partition identifier.
serviceIdstring
The Orleans service identifier.
loggerFactoryILoggerFactory
The logger factory.

Returns

A task which resolves to the initialized checkpointer.

FlushAsync(CancellationToken)

View source
public Task FlushAsync(CancellationToken cancellationToken)
Flushes any pending checkpoint to persistent storage. Awaits any in-progress save, then persists the latest offset if it has advanced beyond the last saved value.

Parameters

cancellationTokenCancellationToken
The cancellation token.

Returns

A task which represents the flush operation.

Load

View source
[System.Obsolete(Use the overload which accepts a CancellationToken.)]
public Task<string> Load()
Loads the checkpoint.

Returns

A task which resolves to the checkpoint offset.

Load(CancellationToken)

View source
public Task<string> Load(CancellationToken cancellationToken)
Loads a checkpoint.

Parameters

cancellationTokenCancellationToken
The cancellation token.

Returns

The checkpoint.

Update(string, DateTime)

View source
[System.Obsolete(Use the overload which accepts a CancellationToken.)]
public void Update(string offset, DateTime utcNow)
Updates the checkpoint. This is a best effort. It does not always update the checkpoint. The latest offset is always tracked in memory so that EventHubCheckpointer can persist it on shutdown.

Parameters

offsetstring
The checkpoint offset.
utcNowDateTime
The current UTC time.

Update(string, DateTime, CancellationToken)

View source
public void Update(string offset, DateTime utcNow, CancellationToken cancellationToken)
Updates the checkpoint.

Parameters

offsetstring
The checkpoint offset.
utcNowDateTime
The current UTC time.
cancellationTokenCancellationToken
The cancellation token.