Class BlobCheckpointStore
java.lang.Object
com.azure.messaging.eventhubs.checkpointstore.blob.BlobCheckpointStore
- All Implemented Interfaces:
CheckpointStore
Implementation of
CheckpointStore
that uses
Storage Blobs
for persisting partition ownership and checkpoint information. EventProcessors
can use
this implementation to load balance and update checkpoints.- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionBlobCheckpointStore
(BlobContainerAsyncClient blobContainerAsyncClient) Creates an instance of BlobCheckpointStore. -
Method Summary
Modifier and TypeMethodDescriptionclaimOwnership
(List<PartitionOwnership> requestedPartitionOwnerships) This method is called by theEventProcessorClient
to claim ownership of a list of partitions.listCheckpoints
(String fullyQualifiedNamespace, String eventHubName, String consumerGroup) Called to get the list of checkpoints from the underlying data store.listOwnership
(String fullyQualifiedNamespace, String eventHubName, String consumerGroup) This method is called by theEventProcessorClient
to get the list of all existing partition ownership from the Storage Blobs.updateCheckpoint
(Checkpoint checkpoint) Updates the checkpoint in Storage Blobs for a partition.
-
Field Details
-
EMPTY_STRING
An empty string.- See Also:
-
-
Constructor Details
-
BlobCheckpointStore
Creates an instance of BlobCheckpointStore.- Parameters:
blobContainerAsyncClient
- TheBlobContainerAsyncClient
this instance will use to read and update blobs in the storage container.
-
-
Method Details
-
listOwnership
public Flux<PartitionOwnership> listOwnership(String fullyQualifiedNamespace, String eventHubName, String consumerGroup) This method is called by theEventProcessorClient
to get the list of all existing partition ownership from the Storage Blobs. Could return empty results if there are is no existing ownership information.- Specified by:
listOwnership
in interfaceCheckpointStore
- Parameters:
eventHubName
- The Event Hub name to get ownership information.consumerGroup
- The consumer group name.fullyQualifiedNamespace
- The fully qualified namespace of the Event Hub. This is likely to be similar to "{your-namespace}.servicebus.windows.net".- Returns:
- A flux of partition ownership details of all the partitions that have/had an owner.
-
listCheckpoints
public Flux<Checkpoint> listCheckpoints(String fullyQualifiedNamespace, String eventHubName, String consumerGroup) Description copied from interface:CheckpointStore
Called to get the list of checkpoints from the underlying data store. This method could return empty results if there are no checkpoints available in the data store.- Specified by:
listCheckpoints
in interfaceCheckpointStore
- Parameters:
fullyQualifiedNamespace
- The fully qualified namespace of the Event Hub.eventHubName
- The Event Hub name to get checkpoint information.consumerGroup
- The consumer group name associated with the checkpoint.- Returns:
- A
Flux
of checkpoints associated with the partitions of the Event Hub.
-
claimOwnership
public Flux<PartitionOwnership> claimOwnership(List<PartitionOwnership> requestedPartitionOwnerships) This method is called by theEventProcessorClient
to claim ownership of a list of partitions. This will return the list of partitions that were owned successfully.- Specified by:
claimOwnership
in interfaceCheckpointStore
- Parameters:
requestedPartitionOwnerships
- List of partition ownerships this instance is requesting to own.- Returns:
- A flux of partitions this instance successfully claimed ownership.
-
updateCheckpoint
Updates the checkpoint in Storage Blobs for a partition.- Specified by:
updateCheckpoint
in interfaceCheckpointStore
- Parameters:
checkpoint
- Checkpoint information containing sequence number and offset to be stored for this partition.- Returns:
- The new ETag on successful update.
-