CheckpointStore interface

A checkpoint store stores and retrieves partition ownership information and checkpoint details for each partition in a given consumer group of an event hub instance.

Users are not meant to implement an CheckpointStore. Users are expected to choose existing implementations of this interface, instantiate it, and pass it to the EventHubConsumerClient class constructor when instantiating a client. Users are not expected to use any of the methods on a checkpoint store, these are used internally by the client.

Implementations of CheckpointStore can be found on npm by searching for packages with the prefix @azure/eventhub-checkpointstore-.

Methods

claimOwnership(PartitionOwnership[], OperationOptions)

Called to claim ownership of a list of partitions. This will return the list of partitions that were owned successfully.

listCheckpoints(string, string, string, OperationOptions)

Lists all the checkpoints in a data store for a given namespace, eventhub and consumer group.

listOwnership(string, string, string, OperationOptions)

Called to get the list of all existing partition ownership from the underlying data store. Could return empty results if there are is no existing ownership information.

updateCheckpoint(Checkpoint, OperationOptions)

Updates the checkpoint in the data store for a partition.

Method Details

claimOwnership(PartitionOwnership[], OperationOptions)

Called to claim ownership of a list of partitions. This will return the list of partitions that were owned successfully.

function claimOwnership(partitionOwnership: PartitionOwnership[], options?: OperationOptions): Promise<PartitionOwnership[]>

Parameters

partitionOwnership

PartitionOwnership[]

The list of partition ownership this instance is claiming to own.

options
OperationOptions

A set of options that can be specified to influence the behavior of this method.

  • abortSignal: A signal used to request operation cancellation.
  • tracingOptions: Options for configuring tracing.

Returns

Promise<PartitionOwnership[]>

A list of partitions this instance successfully claimed ownership.

listCheckpoints(string, string, string, OperationOptions)

Lists all the checkpoints in a data store for a given namespace, eventhub and consumer group.

function listCheckpoints(fullyQualifiedNamespace: string, eventHubName: string, consumerGroup: string, options?: OperationOptions): Promise<Checkpoint[]>

Parameters

fullyQualifiedNamespace

string

The fully qualified Event Hubs namespace. This is likely to be similar to .servicebus.windows.net.

eventHubName

string

The event hub name.

consumerGroup

string

The consumer group name.

options
OperationOptions

A set of options that can be specified to influence the behavior of this method.

  • abortSignal: A signal used to request operation cancellation.
  • tracingOptions: Options for configuring tracing.

Returns

Promise<Checkpoint[]>

A list of checkpoints for a given namespace, eventhub, and consumer group.

listOwnership(string, string, string, OperationOptions)

Called to get the list of all existing partition ownership from the underlying data store. Could return empty results if there are is no existing ownership information.

function listOwnership(fullyQualifiedNamespace: string, eventHubName: string, consumerGroup: string, options?: OperationOptions): Promise<PartitionOwnership[]>

Parameters

fullyQualifiedNamespace

string

The fully qualified Event Hubs namespace. This is likely to be similar to .servicebus.windows.net.

eventHubName

string

The event hub name.

consumerGroup

string

The consumer group name.

options
OperationOptions

A set of options that can be specified to influence the behavior of this method.

  • abortSignal: A signal used to request operation cancellation.
  • tracingOptions: Options for configuring tracing.

Returns

Promise<PartitionOwnership[]>

A list of partition ownership details of all the partitions that have/had an owner.

updateCheckpoint(Checkpoint, OperationOptions)

Updates the checkpoint in the data store for a partition.

function updateCheckpoint(checkpoint: Checkpoint, options?: OperationOptions): Promise<void>

Parameters

checkpoint
Checkpoint

The checkpoint.

options
OperationOptions

A set of options that can be specified to influence the behavior of this method.

  • abortSignal: A signal used to request operation cancellation.
  • tracingOptions: Options for configuring tracing.

Returns

Promise<void>