Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ private EventHubsTriggerMetrics CreateTriggerMetrics(List<PartitionProperties> p
// In that case, LastEnqueuedSequenceNumber will be >= 0

if ((partitionProperties.LastEnqueuedSequenceNumber != -1 && partitionProperties.LastEnqueuedSequenceNumber != (checkpoint?.SequenceNumber ?? -1))
|| (checkpoint == null && partitionProperties.LastEnqueuedSequenceNumber >= 0))
|| (checkpoint == null && partitionProperties.LastEnqueuedSequenceNumber >= 0)
|| (checkpoint != null && checkpoint.Offset == null && partitionProperties.LastEnqueuedSequenceNumber >= 0))
{
long partitionUnprocessedEventCount = GetUnprocessedEventCount(partitionProperties, checkpoint);
totalUnprocessedEventCount += partitionUnprocessedEventCount;
Expand Down Expand Up @@ -157,6 +158,12 @@ private static long GetUnprocessedEventCount(PartitionProperties partitionInfo,
return 1;
}

// Legacy checkpoint support
if (checkpoint != null && checkpoint.Offset == null && partitionInfo.LastEnqueuedSequenceNumber >= 0)
{
return partitionInfo.LastEnqueuedSequenceNumber + 1;
}

var startingSequenceNumber = checkpoint?.SequenceNumber switch
{
// There was no checkpoint, use the beginning sequence number - 1, since
Expand Down