Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Cosmos DB change feed retry a specific document

We are using Cosmos DB change feed to solve some of our requirements. Wanted to understand if there is any retry mechanism available in change feed. For example, if I get a batch of 10 documents and 3rd one can't be processed for some reason, can I replay only the 3rd message again?

There are three ways of consuming change feed:

  1. Azure Functions - Did not see ant retry mechanism for this.

  2. Change feed processor library - If there is any exception in processing a batch of documents, all of them are replayed again.

  3. Azure Cosmos DB SQL API SDK - Have not explored this in detail. But we have complete control on checkpointing, so we can probably replay starting from a failed message.

I am yet to find an option to retry only the failed messages from a batch of messages.

like image 682
Amlan Avatar asked Nov 03 '25 07:11

Amlan


1 Answers

Currently there is no such mechanism, would be good to have though. One way that may help is to use manual checkpointing (CheckpointFrequency in ChangeFeedProcessorSettings, ChangeFeedObserverContext.CheckpointAsync()). But note that even with manual checkpointing the atomic unit is still a batch.

like image 195
Michael Koltachev Avatar answered Nov 05 '25 22:11

Michael Koltachev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!