Show / Hide Table of Contents

Class CheckpointStore

Allows interaction with checkpoint and ownership data needed for event processor operation.

Inheritance
System.Object
CheckpointStore
Namespace: System.Dynamic.ExpandoObject
Assembly: Azure.Messaging.EventHubs.dll
Syntax
public abstract class CheckpointStore

Constructors

CheckpointStore()

Declaration
protected CheckpointStore ();

Methods

ClaimOwnershipAsync(IEnumerable<EventProcessorPartitionOwnership>, CancellationToken)

Attempts to claim ownership of the specified partitions for processing. This operation is used by load balancing to enable distributing the responsibility for processing partitions for an Event Hub and consumer group pairing amongst the active event processors.

Declaration
public abstract System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Azure.Messaging.EventHubs.Primitives.EventProcessorPartitionOwnership>> ClaimOwnershipAsync (System.Collections.Generic.IEnumerable<Azure.Messaging.EventHubs.Primitives.EventProcessorPartitionOwnership> desiredOwnership, System.Threading.CancellationToken cancellationToken);
Parameters
System.Collections.Generic.IEnumerable<EventProcessorPartitionOwnership> desiredOwnership

The set of partition ownership desired by the event processor instance; this is the set of partitions that it will attempt to request responsibility for processing.

System.Threading.CancellationToken cancellationToken

A System.Threading.CancellationToken instance to signal the request to cancel the processing. This is most likely to occur when the processor is shutting down.

Returns
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<EventProcessorPartitionOwnership>>

The set of ownership records for the partitions that were successfully claimed; this is expected to be the desiredOwnership or a subset of those partitions.

GetCheckpointAsync(String, String, String, String, CancellationToken)

Requests checkpoint information for a specific partition, allowing an event processor to resume reading from the next event in the stream.

Declaration
public abstract System.Threading.Tasks.Task<Azure.Messaging.EventHubs.Primitives.EventProcessorCheckpoint> GetCheckpointAsync (string fullyQualifiedNamespace, string eventHubName, string consumerGroup, string partitionId, System.Threading.CancellationToken cancellationToken);
Parameters
System.String fullyQualifiedNamespace

The fully qualified Event Hubs namespace the ownership are associated with. This is likely to be similar to {yournamespace}.servicebus.windows.net.

System.String eventHubName

The name of the specific Event Hub the ownership are associated with, relative to the Event Hubs namespace that contains it.

System.String consumerGroup

The name of the consumer group the checkpoint is associated with.

System.String partitionId

The identifier of the partition to read a checkpoint for.

System.Threading.CancellationToken cancellationToken

A System.Threading.CancellationToken instance to signal a request to cancel the operation.

Returns
System.Threading.Tasks.Task<EventProcessorCheckpoint>

An EventProcessorCheckpoint instance, if a checkpoint was found for the requested partition; otherwise, null.

ListOwnershipAsync(String, String, String, CancellationToken)

Requests a list of the ownership assignments for partitions between each of the cooperating event processor instances for a given Event Hub and consumer group pairing. This operation is used during load balancing to allow the processor to discover other active collaborators and to make decisions about how to best balance work between them.

Declaration
public abstract System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<Azure.Messaging.EventHubs.Primitives.EventProcessorPartitionOwnership>> ListOwnershipAsync (string fullyQualifiedNamespace, string eventHubName, string consumerGroup, System.Threading.CancellationToken cancellationToken);
Parameters
System.String fullyQualifiedNamespace

The fully qualified Event Hubs namespace the ownership are associated with. This is likely to be similar to {yournamespace}.servicebus.windows.net.

System.String eventHubName

The name of the specific Event Hub the ownership is associated with, relative to the Event Hubs namespace that contains it.

System.String consumerGroup

The name of the consumer group the ownership are associated with.

System.Threading.CancellationToken cancellationToken

A System.Threading.CancellationToken instance to signal the request to cancel the processing. This is most likely to occur when the processor is shutting down.

Returns
System.Threading.Tasks.Task<System.Collections.Generic.IEnumerable<EventProcessorPartitionOwnership>>

The set of ownership data to take into account when making load balancing decisions.

UpdateCheckpointAsync(String, String, String, String, Int64, Nullable<Int64>, CancellationToken)

Obsolete.

Creates or updates a checkpoint for a specific partition, identifying a position in the partition's event stream that an event processor should begin reading from.

Declaration
[System.ComponentModel.EditorBrowsable]
[System.Obsolete("The Event Hubs service does not guarantee a numeric offset for all resource configurations.  Checkpoints created from a numeric offset may not work in all cases going forward. Please use a string-based offset via the overload accepting 'CheckpointPosition' instead.", false)]
public virtual System.Threading.Tasks.Task UpdateCheckpointAsync (string fullyQualifiedNamespace, string eventHubName, string consumerGroup, string partitionId, long offset, Nullable<long> sequenceNumber, System.Threading.CancellationToken cancellationToken);
Parameters
System.String fullyQualifiedNamespace

The fully qualified Event Hubs namespace the ownership are associated with. This is likely to be similar to {yournamespace}.servicebus.windows.net.

System.String eventHubName

The name of the specific Event Hub the ownership are associated with, relative to the Event Hubs namespace that contains it.

System.String consumerGroup

The name of the consumer group the checkpoint is associated with.

System.String partitionId

The identifier of the partition the checkpoint is for.

System.Int64 offset

The offset to associate with the checkpoint, intended as informational metadata. This will only be used from positioning if there is no value provided for sequenceNumber.

System.Nullable<System.Int64> sequenceNumber

The sequence number to associate with the checkpoint, indicating that a processor should begin reading from the next event in the stream.

System.Threading.CancellationToken cancellationToken

A System.Threading.CancellationToken instance to signal a request to cancel the operation.

Returns
System.Threading.Tasks.Task

Remarks

This method is obsolete and should no longer be used. Please use UpdateCheckpointAsync(String, String, String, String, String, CheckpointPosition, CancellationToken) instead.

UpdateCheckpointAsync(String, String, String, String, String, CheckpointPosition, CancellationToken)

Creates or updates a checkpoint for a specific partition, identifying a position in the partition's event stream that an event processor should begin reading from.

Declaration
public virtual System.Threading.Tasks.Task UpdateCheckpointAsync (string fullyQualifiedNamespace, string eventHubName, string consumerGroup, string partitionId, string clientIdentifier, Azure.Messaging.EventHubs.Processor.CheckpointPosition startingPosition, System.Threading.CancellationToken cancellationToken);
Parameters
System.String fullyQualifiedNamespace

The fully qualified Event Hubs namespace the ownership are associated with. This is likely to be similar to {yournamespace}.servicebus.windows.net.

System.String eventHubName

The name of the specific Event Hub the ownership are associated with, relative to the Event Hubs namespace that contains it.

System.String consumerGroup

The name of the consumer group the checkpoint is associated with.

System.String partitionId

The identifier of the partition the checkpoint is for.

System.String clientIdentifier

The unique identifier of the client that authored this checkpoint.

CheckpointPosition startingPosition

The starting position to associate with the checkpoint, indicating that a processor should begin reading from the next event in the stream.

System.Threading.CancellationToken cancellationToken

A System.Threading.CancellationToken instance to signal a request to cancel the operation.

Returns
System.Threading.Tasks.Task

Back to top Azure SDK for .NET