I am testing out the new changefeed from DocumentDb. I am connecting this to a Logic app via a polling api.
Because I only want 1 item per request, I have set the MaxItemCount to 1. This works perfectly... until a get passed 36 result. The next request, gives me 70 result (and max item count is set to 1) and +- 150 documents were skipped.
Is this a bug in DocumentDB or am I doing something wrong?
See code, the first 36 times, I only get 1 result, from then I got the issue described above:
var changeFeedOptions = new ChangeFeedOptions
{
MaxItemCount = 1,
RequestContinuation = continuationToken,
PartitionKeyRangeId = partitionKey, // singe partioned collection
StartFromBeginning = fromBeginning
};
var feed = ((DocumentClient) _documentClient).CreateDocumentChangeFeedQuery(
collectionUri,
changeFeedOptions);
var result = await feed.ExecuteNextAsync();
var document = result.FirstOrDefault();
return new ChangeFeedResponse
{
ContinuationToken = result.ResponseContinuation, // this token will be used the next time
Document = document
};