Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface PartitionManager

Package version

A Partition manager 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 PartitionManager. Users are expected to choose existing implementations of this interface, instantiate it, and pass it to the constructor of EventProcessor.

To get started, you can use the InMemoryPartitionManager which will store the relevant information in memory. But in production, you should choose an implementation of the PartitionManager interface that will store the checkpoints and partition ownerships to a durable store instead.

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

Hierarchy

  • PartitionManager

Implemented by

Index

Methods

claimOwnership

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

    Parameters

    • partitionOwnership: PartitionOwnership[]

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

    Returns Promise<PartitionOwnership[]>

    A list of partitions this instance successfully claimed ownership.

listOwnership

  • listOwnership(fullyQualifiedNamespace: string, eventHubName: string, consumerGroupName: string): Promise<PartitionOwnership[]>
  • 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.

    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.

    • consumerGroupName: string

      The consumer group name.

    Returns Promise<PartitionOwnership[]>

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

updateCheckpoint

  • updateCheckpoint(checkpoint: Checkpoint): Promise<string>
  • Updates the checkpoint in the data store for a partition.

    Parameters

    Returns Promise<string>

    The new eTag on successful update.

Generated using TypeDoc